#include <MRModel.h>
Collaboration diagram for MRModel:
Public Members  
MRModel ()  
~MRModel ()  
Void  SimplestModel ()  
Set to the simplest model possible.  
Void  MostComplexModel ()  
Set to the most complex model possible.  
Void  AdaptFaces (Int targetFaces)  
Adapt the model so it has 'targetFaces' faces.  
Void  AdaptClusters (Int targetClusters)  
Adapt the model so it has 'targetClusters' face clusters.  
Void  AdaptComplexity (GCLReal complexity)  
complexity is [0, 1]; adapts model to totalFaces * sqr(c). More...  
Void  AdaptLength ( GCLReal threshold, const Transform &M, const Transform &P, Float timeLimit = vl_inf )  
Adapt so screen error is constant. More...  
Bool  Parse (StrConst filename)  
Bool  ParseBinary ()  
Bool  ParseText ()  
Void  WriteBinary ()  
Void  Draw (Renderer &r)  
Void  PrepareModel ()  
Void  AdjustLeafFaces ()  
Void  PrepareClusters ()  
Void  PrepareVertices ()  
Void  DrawClusterFaces (Int i, Renderer &r)  
Void  DrawClusters (Renderer &r)  
draw representations of face clusters.  
Void  DrawVertices (Renderer &r)  
draw representations of simplification vertices.  
Vector  FaceAreaNormal (Int faceIdx)  
Int  ReorderLeafClusters (Int ic, FaceIdxArray &newFaces)  
Reorder cluster faces consecutively. More...  
Void  CropClusters (Int numClusters)  
Void  CreateClusterColours ()  
Void  DumpFCH (StrConst filename)  
Dump the cluster hierarchy as a .hier file.  
Void  UpdateBounds (Point &min, Point &max, const Transform &t)  
Void  AddContraction ( Int child0, Int child1, Int face1, Int face2, GCLReal error, const Point &p, Int delta )  
Add a vertex contraction to the model.  
Void  AddCluster ( Int child0, Int child1, Point ¢re, VecTrans &axis, Vector &fitNormal, GCLReal d, Point &clusMin, Point &clusMax, Int clusID )  
Add a cluster to the model.  
Bool  IsFace (Int i)  
returns true if the ID belongs to a face.  
FaceCluster&  Cluster (Int i)  
returns a reference to the cluster with ID 'i'.  
PointList*  points  
vertex locations.  
ColourList*  colours  
pervertex colours, if they exist.  
Colour  colour  
model colour.  
FaceIdxArray  faces  
list of face vertex indicies.  
Int  currentFaces  
number of faces in current model.  
IndexList  rootVertices  
root nodes of the vertex forest.  
MRVertexes  vertices  
all vertex nodes.  
MRCodesList  vtxCodes  
tree codes per face.  
MRFlagsList  vtxFlags  
active vertices/faces.  
FaceIdxArray  vtxFaces  
list of extra face info for MMF stuff.  
Bool  verticesPrepped  
Int  currentClusters  
number of clusters in current model.  
Bool  clustersPrepped  
clusters have been preprocessed.  
IndexList  rootClusters  
indices of root clusters.  
FaceClusList  clusters  
all the face clusters.  
ActList  clustersActive  
list of active clusters.  
ColourList  clusterColours  
colours to show varying clusters.  
NormalList  faceNormals  
areaweighted normals.  
Int  firstClusterID  
cluster ID of the first stored cluster.  
Int  lastClusterID  
cluster ID of the last stored cluster.  
Bool  showMeta  
show clusters/vertices.  
Bool  showFaces  
show underlying model.  
Bool  colourFaces  
colour faces according to face clusters.  
FileName  modelFile  
location of source file.  
Flags32  flags  
model flags.  
GCLReal  lastComplexity  
complexity model was last adapted to.  
Static Public Members  
Bool  sAvgClusColours = false  
parent's colour is average of children's. 
Definition at line 27 of file MRModel.h.
MRModel::MRModel () 
Definition at line 61 of file MRModel.cc.
MRModel::~MRModel () 
Definition at line 76 of file MRModel.cc.
Void MRModel::AdaptClusters (Int targetClusters) 
Adapt the model so it has 'targetClusters' face clusters.
Definition at line 371 of file MRModel.cc.
Void MRModel::AdaptComplexity (GCLReal complexity) 
complexity is [0, 1]; adapts model to totalFaces * sqr(c).
We take # faces = complexity^2 * total faces. The justification for this is that if we define complexity as detail in a single dimension, for surfaces the number of faces will go up as the square of the complexity.
Definition at line 443 of file MRModel.cc.
Void MRModel::AdaptFaces (Int targetFaces) 
Void MRModel::AdaptLength (GCLReal threshold, const Transform & M, const Transform & P, Float timeLimit = vl_inf) 
Adapt so screen error is constant.
Given model matrix M and projection matrix P, adapt so that the error in screen space is below threshold.
threshold  screenspace error threshold 
M  model matrix 
P  projection matrix 
timeLimit  time limit in seconds. 
Definition at line 260 of file MRModel.cc.
Void MRModel::AddCluster (Int clusLeft, Int clusRight, Point & clusOrig, VecTrans & clusAxis, Vector & clusFitNormal, GCLReal d, Point & clusMin, Point & clusMax, Int clusID) 
Void MRModel::AddContraction (Int child0, Int child1, Int face0, Int face1, GCLReal error, const Point & p, Int delta) 
Void MRModel::AdjustLeafFaces () 
Adjusts the model's face indexes to match the current active simplified vertices. We do this as a separate operation to the vertex split/edge collapse operations to avoid having to store adjacency information.
Definition at line 460 of file MRModel.cc.
FaceCluster & MRModel::Cluster (Int i) [inline]

Void MRModel::CreateClusterColours () 
Definition at line 1412 of file MRModel.cc.
Void MRModel::CropClusters (Int numClusters) 
Definition at line 532 of file MRModel.cc.
Void MRModel::Draw (Renderer & r) 
Definition at line 1311 of file MRModel.cc.
Void MRModel::DrawClusterFaces (Int ic, Renderer & r) 
Definition at line 1279 of file MRModel.cc.
Void MRModel::DrawClusters (Renderer & r) 
Void MRModel::DrawVertices (Renderer & r) 
Void MRModel::DumpFCH (StrConst filename) 
Vector MRModel::FaceAreaNormal (Int faceIdx) 
Definition at line 1543 of file MRModel.cc.
Bool MRModel::IsFace (Int i) [inline]

Void MRModel::MostComplexModel () 
Bool MRModel::Parse (StrConst filename) 
Definition at line 1243 of file MRModel.cc.
Bool MRModel::ParseBinary () 
Definition at line 820 of file MRModel.cc.
Bool MRModel::ParseText () 
Definition at line 1063 of file MRModel.cc.
Void MRModel::PrepareClusters () 
Definition at line 613 of file MRModel.cc.
Void MRModel::PrepareModel () 
Definition at line 731 of file MRModel.cc.
Void MRModel::PrepareVertices () 
Definition at line 658 of file MRModel.cc.
Int MRModel::ReorderLeafClusters (Int ic, FaceIdxArray & newFaces) 
Reorder cluster faces consecutively.
We reorder the faces so that the faces belonging to a particular cluster come consecutively. This allows us to truncate the cluster hierarchy;
It also provides for the possibility of placing start/end ID fields in the cluster to avoid descending the tree to figure out the faces belonging to a particular cluster.
Definition at line 582 of file MRModel.cc.
Void MRModel::SimplestModel () 
Void MRModel::UpdateBounds (Point & min, Point & max, const Transform & t) 
Definition at line 1556 of file MRModel.cc.
Void MRModel::WriteBinary () 
Definition at line 986 of file MRModel.cc.
ColourList MRModel::clusterColours 
FaceClusList MRModel::clusters 
ActList MRModel::clustersActive 
Bool MRModel::clustersPrepped 
Colour MRModel::colour 
Bool MRModel::colourFaces 
ColourList * MRModel::colours 
Int MRModel::currentClusters 
Int MRModel::currentFaces 
NormalList MRModel::faceNormals 
FaceIdxArray MRModel::faces 
Int MRModel::firstClusterID 
Flags32 MRModel::flags 
Int MRModel::lastClusterID 
GCLReal MRModel::lastComplexity 
FileName MRModel::modelFile 
PointList * MRModel::points 
IndexList MRModel::rootClusters 
IndexList MRModel::rootVertices 
Bool MRModel::sAvgClusColours = false [static]

Bool MRModel::showFaces 
Bool MRModel::showMeta 
MRVertexes MRModel::vertices 
Bool MRModel::verticesPrepped 
MRCodesList MRModel::vtxCodes 
FaceIdxArray MRModel::vtxFaces 
MRFlagsList MRModel::vtxFlags 