Hide menu
Loading...
Searching...
No Matches

Provides MTK data model. More...

Inheritance diagram for cadex.ModelData.Model:
cadex.BaseObject

Public Types

enum  FileFormatType { MTK , MTKWEB }
 Defines supported formats for export.
 

Public Member Functions

 Model (global::System.IntPtr cPtr, bool cMemoryOwn)
 
 Model ()
 Constructor.
 
 Model (cadex.UTF16String theName)
 Constructor.
 
void SetName (cadex.UTF16String theName)
 Sets a model name.
 
cadex.UTF16String Name ()
 Returns a model name.
 
bool IsEmpty ()
 Returns true if the model is empty.
 
void Clear ()
 Clears the model contents.
 
void AddRoot (cadex.ModelData.ModelElement theElement)
 Adds a root element to the model.
 
cadex.Collections.ModelElementList Roots ()
 Returns root elements of the model.
 
uint NumberOfRoots ()
 Returns the number of root elements in the model.
 
void SetDrawing (cadex.Drawing.Drawing theDrawing)
 
cadex.Drawing.Drawing Drawing ()
 
void Merge (cadex.ModelData.Model theModel)
 Adds roots from another model to current.
 
void AssignUuids ()
 Assigns uuid's (persistent id's) to scene graph elements and part representations (if not assigned yet).
 
void Accept (cadex.ModelData.ModelElementVisitor theVisitor)
 Accepts a visitor.
 
bool Open (cadex.UTF16String theFileName, bool theToAppend, cadex.ProgressStatus theProgressStatus)
 
bool Open (cadex.UTF16String theFileName, bool theToAppend)
 
bool Open (cadex.UTF16String theFileName)
 
bool Save (cadex.UTF16String theFileName, cadex.ProgressStatus theProgressStatus)
 
bool Save (cadex.UTF16String theFileName)
 
bool Save (cadex.UTF16String theFileName, cadex.ModelData.Model.FileFormatType theFormat, cadex.ProgressStatus theProgressStatus)
 
bool Save (cadex.UTF16String theFileName, cadex.ModelData.Model.FileFormatType theFormat)
 
- Public Member Functions inherited from cadex.BaseObject
 BaseObject (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
bool IsNull ()
 
ulong Id ()
 Return unique identifier of public object.
 
bool IsEqual (cadex.BaseObject theObj)
 
override int GetHashCode ()
 
override bool Equals (System.Object o)
 

Static Public Member Functions

static cadex.ModelData.Model Cast (cadex.BaseObject theBase)
 

Protected Member Functions

override void Dispose (bool disposing)
 

Detailed Description

Provides MTK data model.

The model encapsulates a scene graph (hierarchy of assemblies and parts) and is thus an entry point to the entire 3D model data.

A model contains a shared pointer to its internal implementation, so simple copying an object will just copy a shared pointer:

ModelData::Model aModel2 = aModel; //both objects will point to the same contents
Provides MTK data model.
Definition Model.cs:30
See also
Product Structure
Examples
MTKConverter/Program.cs, MTKConverter/main.cxx, exploring/bom/Program.cs, exploring/bom/main.cxx, exploring/brep_geometry/Program.cs, exploring/brep_geometry/main.cxx, exploring/brep_topology/Program.cs, exploring/brep_topology/main.cxx, exploring/drawings/Program.cs, exploring/drawings/main.cxx, exploring/mesh/Program.cs, exploring/mesh/main.cxx, exploring/pmi/Program.cs, exploring/pmi/main.cxx, machining/dfm_analyzer/Program.cs, machining/dfm_analyzer/main.cxx, machining/feature_recognizer/Program.cs, machining/feature_recognizer/main.cxx, meshing/mesh_generation/Program.cs, meshing/mesh_generation/main.cxx, molding/dfm_analyzer/Program.cs, molding/dfm_analyzer/main.cxx, molding/feature_recognizer/Program.cs, molding/feature_recognizer/main.cxx, projector/poly_projector/Program.cs, projector/poly_projector/main.cxx, sheet_metal/dfm_analyzer/Program.cs, sheet_metal/dfm_analyzer/main.cxx, sheet_metal/feature_recognizer/Program.cs, sheet_metal/feature_recognizer/main.cxx, sheet_metal/unfolder/Program.cs, sheet_metal/unfolder/main.cxx, utilities/progress_bar/Program.cs, utilities/progress_bar/main.cxx, utilities/thumbnail_generation/Program.cs, utilities/thumbnail_generation/main.cxx, wall_thickness/analyzer/Program.cs, and wall_thickness/analyzer/main.cxx.

Constructor & Destructor Documentation

◆ Model() [1/2]

cadex.ModelData.Model.Model ( )
inline

Constructor.

Creates an empty model. IsEmpty() returns true.

◆ Model() [2/2]

cadex.ModelData.Model.Model ( cadex.UTF16String theName)
inline

Constructor.

Creates an empty model with a name. IsEmpty() returns true.

Member Function Documentation

◆ AddRoot()

void cadex.ModelData.Model.AddRoot ( cadex.ModelData.ModelElement theElement)
inline

Adds a root element to the model.

This function adds theElement as a root element in the model. If the passed element is an instance of ModelData.Instance, it will be automatically nested in ModelData.Assembly.

See also
Roots(), NumberOfRoots().
Examples
MTKConverter/Program.cs.

◆ Clear()

void cadex.ModelData.Model.Clear ( )
inline

Clears the model contents.

Detaches the model contents. Only cleans up contents of this object. Other copies of this object will remain unaffected. For instance, in the following code

Model aM1;
//... populate aM1;
Model aM2 = aM1;
aM1.Clear();
void Clear()
Clears the model contents.
Definition Model.cs:125

the aM2 object will continue to have entire previous contents. Respectively, all previous pointers (e.g. to objects of BaseObject subclasses) remain valid.

See also
IsEmpty().

◆ Dispose()

override void cadex.ModelData.Model.Dispose ( bool disposing)
inlineprotectedvirtual

Reimplemented from cadex.BaseObject.

◆ IsEmpty()

bool cadex.ModelData.Model.IsEmpty ( )
inline

Returns true if the model is empty.

Returns true if the model has no roots, i.e. NumberOfRoots() returns 0.

See also
Clear().
Examples
MTKConverter/Program.cs, MTKConverter/main.cxx, utilities/progress_bar/Program.cs, and utilities/progress_bar/main.cxx.

◆ Name()

◆ NumberOfRoots()

uint cadex.ModelData.Model.NumberOfRoots ( )
inline

Returns the number of root elements in the model.

See also
AddRoot(), Roots(), IsEmpty().

◆ Roots()

cadex.Collections.ModelElementList cadex.ModelData.Model.Roots ( )
inline

Returns root elements of the model.

This function returns the root elements of the model as a std.vector.

See also
AddRoot(), NumberOfRoots().

◆ SetName()

void cadex.ModelData.Model.SetName ( cadex.UTF16String theName)
inline

Sets a model name.

Accepts a string as a unicode string.

See also
Name().
Examples
MTKConverter/Program.cs, and MTKConverter/main.cxx.