Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MRModel Class Reference

#include <MRModel.h>

Collaboration diagram for MRModel:

List of all members.


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 &centre, 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.

FaceClusterCluster (Int i)
returns a reference to the cluster with ID 'i'.

PointListpoints
vertex locations.

ColourListcolours
per-vertex 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
area-weighted 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.


Detailed Description

Definition at line 27 of file MRModel.h.


Constructor & Destructor Documentation

MRModel::MRModel ()

Definition at line 61 of file MRModel.cc.

MRModel::~MRModel ()

Definition at line 76 of file MRModel.cc.


Member Function Documentation

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)

Adapt the model so it has 'targetFaces' faces.

Definition at line 319 of file MRModel.cc.

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.

Parameters:
threshold   screen-space 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)

Add a cluster to the model.

Definition at line 139 of file MRModel.cc.

Void MRModel::AddContraction (Int child0, Int child1, Int face0, Int face1, GCLReal error, const Point & p, Int delta)

Add a vertex contraction to the model.

Definition at line 82 of file MRModel.cc.

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]

returns a reference to the cluster with ID 'i'.

Definition at line 135 of file MRModel.h.

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)

draw representations of face clusters.

Definition at line 1464 of file MRModel.cc.

Void MRModel::DrawVertices (Renderer & r)

draw representations of simplification vertices.

Definition at line 1489 of file MRModel.cc.

Void MRModel::DumpFCH (StrConst filename)

Dump the cluster hierarchy as a .hier file.

Definition at line 484 of file MRModel.cc.

Vector MRModel::FaceAreaNormal (Int faceIdx)

Definition at line 1543 of file MRModel.cc.

Bool MRModel::IsFace (Int i) [inline]

returns true if the ID belongs to a face.

Definition at line 132 of file MRModel.h.

Void MRModel::MostComplexModel ()

Set to the most complex model possible.

Definition at line 1525 of file MRModel.cc.

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 ()

Set to the simplest model possible.

Definition at line 1507 of file MRModel.cc.

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.


Member Data Documentation

ColourList MRModel::clusterColours

colours to show varying clusters.

Definition at line 127 of file MRModel.h.

FaceClusList MRModel::clusters

all the face clusters.

Definition at line 125 of file MRModel.h.

ActList MRModel::clustersActive

list of active clusters.

Definition at line 126 of file MRModel.h.

Bool MRModel::clustersPrepped

clusters have been preprocessed.

Definition at line 123 of file MRModel.h.

Colour MRModel::colour

model colour.

Definition at line 109 of file MRModel.h.

Bool MRModel::colourFaces

colour faces according to face clusters.

Definition at line 141 of file MRModel.h.

ColourList * MRModel::colours

per-vertex colours, if they exist.

Definition at line 108 of file MRModel.h.

Int MRModel::currentClusters

number of clusters in current model.

Definition at line 122 of file MRModel.h.

Int MRModel::currentFaces

number of faces in current model.

Definition at line 113 of file MRModel.h.

NormalList MRModel::faceNormals

area-weighted normals.

Definition at line 128 of file MRModel.h.

FaceIdxArray MRModel::faces

list of face vertex indicies.

Definition at line 110 of file MRModel.h.

Int MRModel::firstClusterID

cluster ID of the first stored cluster.

Definition at line 129 of file MRModel.h.

Flags32 MRModel::flags

model flags.

Definition at line 145 of file MRModel.h.

Int MRModel::lastClusterID

cluster ID of the last stored cluster.

Definition at line 130 of file MRModel.h.

GCLReal MRModel::lastComplexity

complexity model was last adapted to.

Definition at line 146 of file MRModel.h.

FileName MRModel::modelFile

location of source file.

Definition at line 143 of file MRModel.h.

PointList * MRModel::points

vertex locations.

Definition at line 107 of file MRModel.h.

IndexList MRModel::rootClusters

indices of root clusters.

Definition at line 124 of file MRModel.h.

IndexList MRModel::rootVertices

root nodes of the vertex forest.

Definition at line 114 of file MRModel.h.

Bool MRModel::sAvgClusColours = false [static]

parent's colour is average of children's.

Definition at line 147 of file MRModel.h.

Bool MRModel::showFaces

show underlying model.

Definition at line 140 of file MRModel.h.

Bool MRModel::showMeta

show clusters/vertices.

Definition at line 139 of file MRModel.h.

MRVertexes MRModel::vertices

all vertex nodes.

Definition at line 115 of file MRModel.h.

Bool MRModel::verticesPrepped

Definition at line 119 of file MRModel.h.

MRCodesList MRModel::vtxCodes

tree codes per face.

Definition at line 116 of file MRModel.h.

FaceIdxArray MRModel::vtxFaces

list of extra face info for MMF stuff.

Definition at line 118 of file MRModel.h.

MRFlagsList MRModel::vtxFlags

active vertices/faces.

Definition at line 117 of file MRModel.h.


The documentation for this class was generated from the following files:
Generated at Sat Aug 5 00:17:08 2000 for Graphics Class Library by doxygen 1.1.0 written by Dimitri van Heesch, © 1997-2000