Open CASCADE Technology  7.7.0
Static Public Member Functions

XCAFDoc_Editor Class Reference

Tool for edit structure of document. More...

#include <XCAFDoc_Editor.hxx>

Static Public Member Functions

static Standard_Boolean Expand (const TDF_Label &theDoc, const TDF_Label &theShape, const Standard_Boolean theRecursively=Standard_True)
 Converts shape (compound/compsolid/shell/wire) to assembly. More...
 
static Standard_Boolean Expand (const TDF_Label &theDoc, const Standard_Boolean theRecursively=Standard_True)
 Converts all compounds shapes in the document to assembly. More...
 
static Standard_Boolean Extract (const TDF_LabelSequence &theSrcLabels, const TDF_Label &theDstLabel, const Standard_Boolean theIsNoVisMat=Standard_False)
 Clones all labels to a new position, keeping the structure with all the attributes. More...
 
static Standard_Boolean Extract (const TDF_Label &theSrcLabel, const TDF_Label &theDstLabel, const Standard_Boolean theIsNoVisMat=Standard_False)
 Clones the label to a new position, keeping the structure with all the attributes. More...
 
static TDF_Label CloneShapeLabel (const TDF_Label &theSrcLabel, const Handle< XCAFDoc_ShapeTool > &theSrcShapeTool, const Handle< XCAFDoc_ShapeTool > &theDstShapeTool, TDF_LabelDataMap &theMap)
 Copies shapes label with keeping of shape structure (recursively) More...
 
static void CloneMetaData (const TDF_Label &theSrcLabel, const TDF_Label &theDstLabel, NCollection_DataMap< Handle< XCAFDoc_VisMaterial >, Handle< XCAFDoc_VisMaterial >> *theVisMatMap, const Standard_Boolean theToCopyColor=Standard_True, const Standard_Boolean theToCopyLayer=Standard_True, const Standard_Boolean theToCopyMaterial=Standard_True, const Standard_Boolean theToCopyVisMaterial=Standard_True, const Standard_Boolean theToCopyAttributes=Standard_True)
 Copies metadata contains from the source label to the destination label. Protected against creating a new label for non-existent tools. More...
 
static Standard_Boolean RescaleGeometry (const TDF_Label &theLabel, const Standard_Real theScaleFactor, const Standard_Boolean theForceIfNotRoot=Standard_False)
 Applies geometrical scaling to the following assembly components: More...
 

Detailed Description

Tool for edit structure of document.

Member Function Documentation

◆ CloneMetaData()

static void XCAFDoc_Editor::CloneMetaData ( const TDF_Label theSrcLabel,
const TDF_Label theDstLabel,
NCollection_DataMap< Handle< XCAFDoc_VisMaterial >, Handle< XCAFDoc_VisMaterial >> *  theVisMatMap,
const Standard_Boolean  theToCopyColor = Standard_True,
const Standard_Boolean  theToCopyLayer = Standard_True,
const Standard_Boolean  theToCopyMaterial = Standard_True,
const Standard_Boolean  theToCopyVisMaterial = Standard_True,
const Standard_Boolean  theToCopyAttributes = Standard_True 
)
static

Copies metadata contains from the source label to the destination label. Protected against creating a new label for non-existent tools.

Parameters
[in]theSrcLabeloriginal label to copy from
[in]theDstLabeldestination shape label to set attributes
[in]theVisMatMaprelating map of the original VisMaterial and created. Can be NULL for the same document
[in]theToCopyColorcopying visible value and shape color (handled all color type)
[in]theToCopyLayercopying layer
[in]theToCopyMaterialcopying material
[in]theToCopyVisMaterialcopying visual material
[in]theToCopyAttributescopying of other node attributes, for example, a shape's property

◆ CloneShapeLabel()

static TDF_Label XCAFDoc_Editor::CloneShapeLabel ( const TDF_Label theSrcLabel,
const Handle< XCAFDoc_ShapeTool > &  theSrcShapeTool,
const Handle< XCAFDoc_ShapeTool > &  theDstShapeTool,
TDF_LabelDataMap theMap 
)
static

Copies shapes label with keeping of shape structure (recursively)

Parameters
[in]theSrcLabeloriginal label to copy from
[in]theSrcShapeToolshape tool to get
[in]theDstShapeToolshape tool to set
[out]theMaprelating map of the original shapes label and labels created from them
Returns
result shape label

◆ Expand() [1/2]

static Standard_Boolean XCAFDoc_Editor::Expand ( const TDF_Label theDoc,
const Standard_Boolean  theRecursively = Standard_True 
)
static

Converts all compounds shapes in the document to assembly.

Parameters
[in]theDocinput document
[in]theRecursivelyrecursively expand a compound subshape
Returns
True if shape successfully expanded

◆ Expand() [2/2]

static Standard_Boolean XCAFDoc_Editor::Expand ( const TDF_Label theDoc,
const TDF_Label theShape,
const Standard_Boolean  theRecursively = Standard_True 
)
static

Converts shape (compound/compsolid/shell/wire) to assembly.

Parameters
[in]theDocinput document
[in]theShapeinput shape label
[in]theRecursivelyrecursively expand a compound subshape
Returns
True if shape successfully expanded

◆ Extract() [1/2]

static Standard_Boolean XCAFDoc_Editor::Extract ( const TDF_Label theSrcLabel,
const TDF_Label theDstLabel,
const Standard_Boolean  theIsNoVisMat = Standard_False 
)
static

Clones the label to a new position, keeping the structure with all the attributes.

Parameters
[in]theSrcLabeloriginal label to copy from
[in]theDstLabellabel to set result as a component of or a main document's label to simply set new shape
[in]theIsNoVisMatget a VisMaterial attributes as is or convert to color
Returns
True if shape successfully extracted

◆ Extract() [2/2]

static Standard_Boolean XCAFDoc_Editor::Extract ( const TDF_LabelSequence theSrcLabels,
const TDF_Label theDstLabel,
const Standard_Boolean  theIsNoVisMat = Standard_False 
)
static

Clones all labels to a new position, keeping the structure with all the attributes.

Parameters
[in]theSrcLabelsoriginal labels to copy from
[in]theDstLabellabel to set result as a component of or a main document's label to simply set new shape
[in]theIsNoVisMatget a VisMaterial attributes as is or convert to color
Returns
True if shape successfully extracted

◆ RescaleGeometry()

static Standard_Boolean XCAFDoc_Editor::RescaleGeometry ( const TDF_Label theLabel,
const Standard_Real  theScaleFactor,
const Standard_Boolean  theForceIfNotRoot = Standard_False 
)
static

Applies geometrical scaling to the following assembly components:

  • part geometry
  • sub-assembly/part occurrence location
  • part's centroid, area and volume attributes
  • PMIs (warnings and errors are reported if it is impossible to make changes) Normally, should start from a root sub-assembly, but if theForceIfNotRoot true scaling will be applied forcibly. If theLabel corresponds to the shape tool scaling is applied to the whole assembly.
    Parameters
    [in]theLabelstarting label
    [in]theScaleFactorscale factor, should be positive
    [in]theForceIfNotRootallows scaling of a non root assembly if true, otherwise - returns false
    Returns
    true in case of success, otherwise - false.

The documentation for this class was generated from the following file: