Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
SceneOptimizer.h File Reference

Detailed Description

CSceneOptimizer handles an advanced multi-object optimization in different ways

#include "PolygonCruncherInterface.h"
#include "3DFaceList.h"
#include "MultiresolutionObject.h"
#include "MRCommon.h"

Go to the source code of this file.

Classes

class  CSceneOptimizer
 CSceneOptimizer is the main entry to optimize a scene. There are various optimization modes and which includes keeping UV or not, keeping vertex colors or not... More...
 
struct  CSceneOptimizer::OptimizableObjectInfo
 
struct  CSceneOptimizer::MagicCruncherParams
 

Macros

#define MIN_PAIR_VALUE   ((real)-3.402823466E+38)
 
#define CURRENT_POLYGON_CRUNCHER_SETTINGS_VERSION   2
 
#define OPTIMIZE_NO_CONSTRAINT   -1.0f
 
#define OPTIMIZE_UNDEFINED_TOLERANCE   (-1.0f)
 
#define COptimizerWnd   CWnd
 

Typedefs

typedef enum OptimizerResult OptimizerResult
 
typedef enum SCENEOPTIMIZER_FLAGS SCENEOPTIMIZER_FLAGS
 

Enumerations

enum  OptimizerResult {
  ORIGINAL_OBJECT = 0x01 , OPTIMIZED_OBJECT_FOR_DISPLAY = 0x02 , OPTIMIZED_OBJECT_CLEANED = 0x04 , OPTIMIZED_CURRENT_SCENE = 0x08 ,
  OPTIMIZED_MULTIRESOLUTION_SCENE = 0x10 , OPTIMIZED_CLEANED_MULTIRESOLUTION_SCENE = 0x20 , OPTIMIZED_APPLY_TO_SCENE = 0x40 , OPTIMIZED_COPY_SCENE = 0x100 ,
  OPTIMIZED_DELETE_ORIGINAL_SCENE = 0x200 , OPTIMIZED_COPY_SELECTION = 0x400
}
 
enum  SCENEOPTIMIZER_FLAGS {
  SCENEOPTIMIZER_OPTIMIZATION_FLAGS = 0x0000FFFF , SCENEOPTIMIZER_NONE = 0x00 , SCENEOPTIMIZER_EXCLUDE_HIDDEN_NODES = 0x01 , SCENEOPTIMIZER_HIDE_FROZEN_FACES = 0x02 ,
  SCENEOPTIMIZER_PROGRESSIVE_RATIO = 0x04 , SCENEOPTIMIZER_INITIALIZATION_FLAGS = 0x00FF0000 , SCENEOPTIMIZER_INTERACTIVE_MODE = 0x00010000 , SCENEOPTIMIZER_TRACK_CHANGES = 0x00020000 ,
  SCENEOPTIMIZER_INTERNAL_FLAGS = 0xFF000000 , SCENEOPTIMIZER_DELETE_SCENE = 0x01000000 , SCENEOPTIMIZER_NEW_SCENE_LOADED = 0x02000000
}
 

Enumeration Type Documentation

◆ OptimizerResult

These flags are used in CSceneOptimizer::GetScene to obtain the result optimization

Enumerator
ORIGINAL_OBJECT 

Internal purpose: get the original scene (not optimized), if possible. When it's possible, don't free returned scene.

OPTIMIZED_OBJECT_FOR_DISPLAY 

Internal purpose: get a scene which has invalid face. For OpenGL display purpose only. Don't free returned scene.

OPTIMIZED_OBJECT_CLEANED 

Get a cleaned scene which can be used outside Polygon Cruncher. Use for converting or saving the optimization result. Don't free returned scene unless OPTIMIZED_COPY_SCENE is used. To be used with static optimization. Cf. #OPTIMIZATION.

OPTIMIZED_CURRENT_SCENE 

Internal purpose: returns the original scene (if no Optimize not already called) or potentialy optimized (if it has been optimized and if SCENEOPTIMIZER_INTERACTIVE_MODE is not set). Don't free returned scene unless OPTIMIZED_COPY_SCENE used.

OPTIMIZED_MULTIRESOLUTION_SCENE 

Return a scene containing multiresolution object (compute this scene if needed). Free returned scene if OPTIMIZED_COPY_SCENE set. cf. #OPTIMIZATION_DYNAMIC.

OPTIMIZED_CLEANED_MULTIRESOLUTION_SCENE 

Returns a cleaned scene from the current multiresolution scene ratio. The multiresolution scene is frozen and ratio can't be changed anymore unless OPTIMIZED_COPY_SCENE is set. In that case, caller must free the returned scene if OPTIMIZED_COPY_SCENE is set.

OPTIMIZED_APPLY_TO_SCENE 

Internal purpose: returns the scene or the multiresolution scene. Don't free the returned scene. The flag is used alone. No copy is possible.

OPTIMIZED_COPY_SCENE 

Return a copy of the scene. To be use in special case only with OPTIMIZED_CLEANED_MULTIRESOLUTION_SCENE (duplicate memory)

OPTIMIZED_DELETE_ORIGINAL_SCENE 

Delete the original scene which is the scene provided to CSceneOptimizer::SetScene. To be used with OPTIMIZED_MULTIRESOLUTION_SCENE or OPTIMIZED_CLEANED_MULTIRESOLUTION_SCENE mode.

OPTIMIZED_COPY_SELECTION 

Internal purpose: returns a copy of the selected node in the scene, or the whole scene if no selection exists. To be used in special case only with OPTIMIZED_CLEANED_MULTIRESOLUTION_SCENE (duplicate memory)

◆ SCENEOPTIMIZER_FLAGS

Defines the way CSceneOptimizer mode and if you'll use static / dynamic / interactive mode.

static: nor SCENEOPTIMIZER_TRACK_CHANGES nor SCENEOPTIMIZER_TRACK_CHANGES must be set. There no multiresolution scene.
dynamic: SCENEOPTIMIZER_TRACK_CHANGES only must be set. A multiresolution scene can be get and you can change the ratio as you want.
interactive: both SCENEOPTIMIZER_TRACK_CHANGES and SCENEOPTIMIZER_TRACK_CHANGES must be set. A multiresolution scene can be get and you can change the ratio as you want and modify the optimization mode if needed.

Enumerator
SCENEOPTIMIZER_EXCLUDE_HIDDEN_NODES 

The optimizer excludes hidden nodes.

SCENEOPTIMIZER_HIDE_FROZEN_FACES 

The optimizer only displays the face to be optimized, hides the frozen faces.

SCENEOPTIMIZER_PROGRESSIVE_RATIO 

When optimizing several meshes with great differences in the number of faces, that flag makes the ratio progressive depending on the number of face of each object.
Doing that, objects with many faces are optimized more than objects with few faces using the same optimize ratio.

SCENEOPTIMIZER_INTERACTIVE_MODE 

Interactive mode is to be used with SCENEOPTIMIZER_TRACK_CHANGES when you need to get a multiresolution scene and change the optimization settings. Cf. #OPTIMIZATION_INTERACTIVE.

SCENEOPTIMIZER_TRACK_CHANGES 

Dynamic mode which allows to produce a multiresolution scene, by keeping trace of each optimization steps. Cf. #OPTIMIZATION_DYNAMIC.

SCENEOPTIMIZER_DELETE_SCENE 

Set by CSceneOptimizer::SetScene. The optimizer will delete automatically the provided scene to be optimized. If a multiresolution scene has been required, it is always automatically deleted by the optimizer.

SCENEOPTIMIZER_NEW_SCENE_LOADED 

Private. A new scene has been set (using the load menu for example)