6#if !defined(AFX_MULTIRESOLUTIONOBJECT_H__D5DC4844_4F14_11D3_A382_E4DDA37A4B21__INCLUDED_)
7#define AFX_MULTIRESOLUTIONOBJECT_H__D5DC4844_4F14_11D3_A382_E4DDA37A4B21__INCLUDED_
17#include "MRBaseObject.h"
20BEGIN_MOOTOOLS_NAMESPACE
24class CTrackContractions;
42 unsigned int magicTarget;
56 void DetachOptimizer();
64 void SetOptimizer(
CSceneOptimizer *sceneOptimizer) { this->sceneOptimizer = sceneOptimizer; }
68 virtual unsigned int GetMagicTarget()
const = 0;
69 virtual void SetMagicTarget(
unsigned int ratio) = 0;
70 virtual double GetCurrentRatio()
const = 0;
71 virtual int GetRemovableFaceNbr()
const = 0;
72 virtual int GetRemovablePtNbr()
const = 0;
73 virtual void GetMinSize(
int& minFaceSize,
int& minPointSize)
const = 0;
74 virtual void GetMaxSize(
int& maxFaceSize,
int& maxPointSize)
const = 0;
75 virtual void GetCurrentSize(
int& currentFaceSize,
int& currentPointSize)
const = 0;
77 virtual void SetMinSize(
int minFaceSize,
int minPointSize) = 0;
78 virtual void SetMaxSize(
int maxFaceSize,
int maxPointSize) = 0;
81 virtual bool IsRatioLocked()
const = 0;
83 virtual bool IsMultiResFlagSet(MROBJECT_PROPERTIES
flag)
const = 0;
84 virtual void SetMultiResFlag(MROBJECT_PROPERTIES
flag,
bool set) = 0;
87 virtual void SetProgressiveThreshold(
double threshold) = 0;
88 virtual double GetProgressiveThreshold()
const = 0;
91 virtual int SetObjectRatio(
double ratio,
int requiredNbr,
unsigned int mode = OPTIMIZE_TO_FACE|OPTIMIZE_TO_RATIO) = 0;
100class CTrackContractions;
107 CTrackContractions *trackInfo;
109 double progressiveThreshold;
110 unsigned int multiresFlags;
118 int currentPointSize;
124 bool firstTime, lockSetObjectRatio;
130 virtual void Clean();
156 virtual void GetMinSize(
int& minFaceSize,
int& minPointSize)
const;
157 virtual void GetMaxSize(
int& maxFaceSize,
int& maxPointSize)
const;
164 virtual bool IsRatioLocked()
const;
167 virtual void SetMultiResFlag(MROBJECT_PROPERTIES
flag,
bool set);
170 virtual void SetProgressiveThreshold(
double threshold);
171 virtual double GetProgressiveThreshold()
const;
181 void SetTrackInfo(CTrackContractions *info);
182 const CTrackContractions *GetTrackInfo()
const {
return trackInfo; }
185#ifndef MOOTOOLS_NO_MR
196 virtual void FreezeObject();
197 virtual bool PrepareGeometry();
204 virtual unsigned int *
AddFace(
unsigned int index);
207 virtual void SetFaceMaterial(
unsigned int index,
unsigned short material);
208 virtual MRMaterialID GetFaceMaterial(
unsigned int index)
const;
210 virtual float *AddPoint(
unsigned int index);
211 virtual float *GetPoint(
unsigned int index);
213 virtual unsigned int *
AddUVFace(
unsigned char channel,
unsigned int index,
bool unused);
214 virtual unsigned int *
GetUVIndexes(
unsigned char channel,
unsigned int index);
215 virtual float *
AddUVPoint(
unsigned char channel,
unsigned int index);
216 virtual float *
GetUVPoint(
unsigned char channel,
unsigned int index);
225 virtual unsigned int GetMagicTarget()
const;
226 virtual void SetMagicTarget(
unsigned int ratio);
227 virtual double GetCurrentRatio()
const;
229 virtual int GetRemovableFaceNbr()
const;
230 virtual int GetRemovablePtNbr()
const;
231 virtual void GetMinSize(
int& minFaceSize,
int& minPointSize)
const;
232 virtual void GetMaxSize(
int& maxFaceSize,
int& maxPointSize)
const;
233 virtual void GetCurrentSize(
int& currentFaceSize,
int& currentPointSize)
const;
235 virtual void SetMinSize(
int minFaceSize,
int minPointSize);
236 virtual void SetMaxSize(
int maxFaceSize,
int maxPointSize);
238 virtual void LockRatio(
bool lock);
239 virtual bool IsRatioLocked()
const;
241 virtual bool IsMultiResFlagSet(MROBJECT_PROPERTIES
flag)
const;
242 virtual void SetMultiResFlag(MROBJECT_PROPERTIES
flag,
bool set);
244 virtual void SetProgressive(
bool set);
245 virtual void SetProgressiveThreshold(
double threshold);
246 virtual double GetProgressiveThreshold()
const;
248 bool NeedUpdate()
const;
251 int SetObjectRatio(
double ratio,
int requiredNbr,
unsigned int mode = OPTIMIZE_TO_FACE|OPTIMIZE_TO_RATIO);
253 virtual void Clean();
257END_MOOTOOLS_NAMESPACE
The file contains C3DObject class definition which handles N-Gons polygonal object.
This is the base class for any kind of object.
Definition 3DBaseObject.h:106
This class handles static optimization of an object.
Definition 3DExtObject.h:66
virtual bool Update(C3DScene *scene, unsigned int updateMode)
Information that have been invalidated are recomputed when calling this method.IsInstanciated.
virtual void Clean()
Clean the object by faces and points which flag have been set to invalid. Update channels accordingly...
This class can be provided in C3DScene::Copy operations and allows to modify the created kind of clas...
Definition 3DScene.h:47
C3DObject handles polygonal mesh.
Definition 3DObject.h:24
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
A node matches one element that is part of the C3DScene graph. It references a C3DBaseObject and has ...
Definition 3DSceneNode.h:64
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
CMultiresolutionObject1 is a the multiresolution object class computed from C3DSceneOptimizer::GetSce...
Definition MultiresolutionObject.h:102
virtual void GetCurrentSize(int ¤tFaceSize, int ¤tPointSize) const
Current number of points and faces.
virtual void SetMagicTarget(unsigned int ratio)
Get the optimal MagicCruncher found giving the MagicCruncher parameters.
virtual bool IsMultiResFlagSet(MROBJECT_PROPERTIES flag) const
Set one of the.
virtual int GetRemovableFaceNbr() const
Number of removable faces.
virtual void LockRatio(bool lock)
the ratio is locked and cannot be changed
virtual void GetMaxSize(int &maxFaceSize, int &maxPointSize) const
Maximal number of points and faces.
virtual void SetMaxSize(int maxFaceSize, int maxPointSize)
Set the maximum point/face size the objet have at highest ratio.
virtual void SetMinSize(int minFaceSize, int minPointSize)
Set the minimum point/face size the objet have at lowest ratio.
int SetObjectRatio(double ratio, int requiredNbr, unsigned int mode=OPTIMIZE_TO_FACE|OPTIMIZE_TO_RATIO)
Modify the level of details of the object using a ratio and/or mode defined by MRRATIO_MODE.
virtual unsigned int GetMagicTarget() const
Called by MagicCruncher which set the ratio found to be optimal.
CMultiresolutionObject1(CSceneOptimizer *optimizer=NULL, C3DExtObject *extObject=NULL, C3DSceneNode *srcNode=NULL)
CMultiresolutionObject is usually created using CSceneOptimizer::GetScene or C3DExtObject::GetMultire...
virtual int GetRemovablePtNbr() const
Number of removable points.
virtual double GetCurrentRatio() const
Current optimization ratio.
virtual void SetProgressive(bool set)
The object uses the provided progressive threshold (set MROBJECT_PROGRESSIVE_RATIO flag which is used...
virtual int GetTargetCount(double ratio, unsigned int mode, bool &canBeOptimizedButleftUnoptimized) const
return the approx. final number of point or faces giving a ratio accordingly to target mode (OPTIMIZE...
virtual void GetMinSize(int &minFaceSize, int &minPointSize) const
Minimal number of points and faces.
void FreezeObject()
Freeze the object at a given ratio and clean the object. Removes any multiresolution data and further...
CMultiresolutionObject is the base class for multiresolution object. There is two kind of multiresolu...
Definition MultiresolutionObject.h:33
virtual void FreezeObject()
This remove the multiresolution data, freezes the object at its given level of details and clean it,...
virtual void SetMaxSize(int maxFaceSize, int maxPointSize)=0
Set the maximum point/face size the objet have at highest ratio.
virtual void LockRatio(bool lock)=0
the ratio is locked and cannot be changed
virtual int GetTargetCount(double ratio, unsigned int mode, bool &canBeOptimizedButleftUnoptimized) const =0
return the approx. final number of point or faces giving a ratio accordingly to target mode (OPTIMIZE...
C3DSceneNode * GetSrcNode() const
Return the node of the original scene (if any) to which the object refers. (note: if the original sce...
Definition MultiresolutionObject.h:58
virtual void SetProgressive(bool set)=0
The object uses the provided progressive threshold (set MROBJECT_PROGRESSIVE_RATIO flag which is used...
virtual double GetLastKnownRatio(bool &unknownRatio) const
Return the last requested ratio used with OPTIMIZE_TO_RATIO (progressiveThreshold adjustement is not ...
C3DExtObject * GetExtObject() const
Return the optimized undynamic object (if any)
Definition MultiresolutionObject.h:59
virtual void SetMinSize(int minFaceSize, int minPointSize)=0
Set the minimum point/face size the objet have at lowest ratio.
CSceneOptimizer is the main entry to optimize a scene. There are various optimization modes and which...
Definition SceneOptimizer.h:147
CUVWFaceList is a CFaceList that contains CUVWFace. It usually belongs to a CUVWChannel.
Definition UVWFaceList.h:21
CUVWPointList is an array of CUVWPoint. It usually belongs to a CUVWChannel.
Definition UVWPointList.h:46