XCAFDoc
OCCT package XCAFDoc: XCAFDoc, XCAFDoc_Area, XCAFDoc_AssemblyGraph, XCAFDoc_AssemblyGraph_Iterator, and 36 more bound classes.
XCAFDoc
Definition of general structure of DECAF document and tools to work with it.
The document is composed of sections, each section storing its own kind of data and managing by corresponding tool Some properties can be attached directly to shapes. These properties are:
- Name (the standard definition from OCAF) - class
TDataStd_Name - Centroid (for the validation of transfer) - class
XCAFDoc_Centroid - Volume (for the validation of transfer) - class
XCAFDoc_Volume - Area (for the validation of transfer) - class XCafDoc_Area Management of these attributes is realized by OCAF. For getting the attributes attached to a label the method class
TDF_Label::FindAttribute()should be used.
Constructors(1)
Static methods(25)
class for containing GraphNodes. Returns GUID for UAttribute identifying assembly
Returns GUID for TreeNode representing assembly link.
- ColorRefGUID(type_: XCAFDoc_ColorType): Standard_GUID
Return GUIDs for TreeNode representing specified types of colors.
Parameters (1)type_
Return GUIDs for TreeNode representing specified types of DGT.
Return GUIDs for TreeNode representing specified types of Dimension.
Return GUIDs for TreeNode representing specified types of Dimension.
Return GUIDs for TreeNode representing specified types of GeomTolerance.
Return GUIDs for TreeNode representing specified types of datum.
Return GUIDs for TreeNode representing connections Datum-Toler.
Return GUID for TreeNode representing Visualization Material.
Return GUIDs for representing notes.
Returns GUID for UAttribute identifying external reference on no-step file.
Returns GUID for UAttribute identifying specified higher usage occurrence.
Return GUIDs for TreeNode representing specified types of View.
Return GUIDs for TreeNode representing specified types of View.
Return GUIDs for TreeNode representing specified types of View.
Return GUIDs for TreeNode representing specified types of View.
Return GUIDs for GraphNode representing specified types of View.
Returns GUID for UAttribute identifying lock flag.
Prints attribute information into a string.
Parameters (1)theAtt—an XDE attribute
Returnsthe generated info value
XCAFDoc_Area
attribute to store area
Constructors(1)
class methods
Static methods(6)
- Set(label: TDF_Label, value: number): XCAFDoc_Area
Find, or create, an Area attribute and set its value.
Parameters (2)labelvalue
- Set(label: TDF_Label, guid: Standard_GUID, value: number): TDataStd_Real
Sets a value of volume.
Parameters (3)labelguidvalue
Returns volume of area as argument and success status returns false if no such attribute at the <label>.
Parameters (2)labelarea
ReturnsA result object with fields:
returnValue: the C++ return valuearea: updated value from the call.
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Returns the ID of the attribute.
- Set(V: number): void
Sets a value of volume.
Parameters (1)V
- Get(): number
XCAFDoc_AssemblyGraph
Constructors(2)
- constructor(theDoc: TDocStd_Document): XCAFDoc_AssemblyGraph
Constructs graph from XCAF document. Construction of a formal graph will be done immediately.
Parameters (1)theDoc—- document to iterate.
- constructor(theLabel: TDF_Label): XCAFDoc_AssemblyGraph
Constructs graph from XCAF label. Construction of a formal graph will be done immediately. The specified label is used as a starting position.
Parameters (1)theLabel—- starting position.
Instance methods(12)
- Returns
Document shape tool.
- GetRoots(): TColStd_PackedMapOfInteger
Returns IDs of the root nodes.
ReturnsIDs of the root nodes.
- IsDirectLink(theNode1: number, theNode2: number): boolean
Checks whether the assembly graph contains (n1, n2) directed link.
Parameters (2)theNode1—- one-based ID of the first node.
theNode2—- one-based ID of the second node.
Returnstrue/false.
- HasChildren(theNode: number): boolean
Checks whether direct children exist for the given node.
Parameters (1)theNode—- one-based node ID.
Returnstrue/false.
- GetChildren(theNode: number): TColStd_PackedMapOfInteger
Returns IDs of child nodes for the given node.
Parameters (1)theNode—- one-based node ID.
Returnsset of child IDs.
- GetNodeType(theNode: number): XCAFDoc_AssemblyGraph_NodeType
Returns the node type from
NodeTypeenum.Parameters (1)theNode—- one-based node ID.
Returnsnode type.
See alsoNodeType
returns object ID by node ID.
Parameters (1)theNode—- one-based node ID.
Returnspersistent ID.
Returns the unordered set of graph nodes.
Returnsgraph nodes.
- NbNodes(): number
Returns the number of graph nodes.
Returnsnumber of graph nodes.
Returns the collection of graph links in the form of adjacency matrix.
Returnsgraph links.
- NbLinks(): number
Returns the number of graph links.
Returnsnumber of graph links.
- NbOccurrences(theNode: number): number
Returns quantity of part usage occurrences.
Parameters (1)theNode—- one-based part ID.
Returnsusage occurrence quantity.
XCAFDoc_AssemblyGraph_Iterator
Constructors(1)
- constructor(theGraph: XCAFDoc_AssemblyGraph, theNode?: number): XCAFDoc_AssemblyGraph_IteratorParameters (2)
theGraphtheNode
Instance methods(3)
XCAFDoc_AssemblyItemId
Unique item identifier in the hierarchical product structure. A full path to an assembly component in the "part-of" graph starting from the root node.
Constructors(3)
Constructs an empty item ID.
Constructs an item ID from a list of strings, where every string is a label entry.
Parameters (1)thePath—- list of label entries.
- constructor(theString: TCollection_AsciiString): XCAFDoc_AssemblyItemId
Constructs an item ID from a formatted path, where label entries are separated by '/' symbol.
Parameters (1)theString—- formatted full path.
Instance methods(9)
- Init(thePath: NCollection_List_TCollection_AsciiString): void
Initializes the item ID from a list of strings, where every string is a label entry.
Parameters (1)thePath—- list of label entries.
- Init(theString: TCollection_AsciiString): void
Initializes the item ID from a formatted path, where label entries are separated by '/' symbol.
Parameters (1)theString—- formatted full path.
- IsNull(): boolean
Returns true if the full path is empty, otherwise - false.
- Nullify(): void
Clears the full path.
- IsChild(theOther: XCAFDoc_AssemblyItemId): boolean
Checks if this item is a child of the given item.
Parameters (1)theOther—- potentially ancestor item.
Returnstrue if the item is a child of theOther item, otherwise - false.
- IsDirectChild(theOther: XCAFDoc_AssemblyItemId): boolean
Checks if this item is a direct child of the given item.
Parameters (1)theOther—- potentially parent item.
Returnstrue if the item is a direct child of theOther item, otherwise - false.
- IsEqual(theOther: XCAFDoc_AssemblyItemId): boolean
Checks for item IDs equality.
Parameters (1)theOther—- the item ID to check equality with.
Returnstrue if this ID is equal to theOther, otherwise - false.
Returns the full path as a list of label entries.
Returns the full pass as a formatted string.
XCAFDoc_AssemblyItemRef
An attribute that describes a weak reference to an assembly item or to a subshape or to an assembly label attribute.
Constructors(1)
Creates an empty reference attribute.
Static methods(7)
- get_type_name(): string
- Get(theLabel: TDF_Label): XCAFDoc_AssemblyItemRef
Finds a reference attribute on the given label and returns it, if it is found.
Parameters (1)theLabel
- Set(theLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId): XCAFDoc_AssemblyItemRefParameters (2)
theLabeltheItemId
- Set(theLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID): XCAFDoc_AssemblyItemRefParameters (3)
theLabeltheItemIdtheGUID
- Set(theLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theShapeIndex: number): XCAFDoc_AssemblyItemRefParameters (3)
theLabeltheItemIdtheShapeIndex
Instance methods(18)
- IsOrphan(): boolean
Checks if the reference points to a really existing item in XDE document.
- HasExtraRef(): boolean
- IsGUID(): boolean
- IsSubshapeIndex(): boolean
- GetSubshapeIndex(): number
Returns the assembly item ID that the reference points to.
- SetItem(theItemId: XCAFDoc_AssemblyItemId): voidParameters (1)
theItemId
- SetItem(thePath: NCollection_List_TCollection_AsciiString): voidParameters (1)
thePath
- SetItem(theString: TCollection_AsciiString): voidParameters (1)
theString
- SetGUID(theAttrGUID: Standard_GUID): voidParameters (1)
theAttrGUID
- SetSubshapeIndex(theShapeIndex: number): voidParameters (1)
theShapeIndex
- ClearExtraRef(): void
Reverts the reference to empty state.
- ID(): Standard_GUID
Returns the ID of the attribute.
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_AssemblyIterator
Iterator in depth along the assembly tree.
Constructors(2)
- constructor(theDoc: TDocStd_Document, theLevel?: number): XCAFDoc_AssemblyIterator
Constructs iterator starting from assembly roots.
Parameters (2)theDoc—- document to iterate.
theLevel
- constructor(theDoc: TDocStd_Document, theRoot: XCAFDoc_AssemblyItemId, theLevel?: number): XCAFDoc_AssemblyIterator
Constructs iterator starting from the specified position in the assembly tree.
Parameters (3)theDoc—- document to iterate.
theRoot—- assembly item to start iterating from.
theLevel
Instance methods(3)
XCAFDoc_AssemblyTool
Provides generic methods for traversing assembly tree and graph.
Constructors(1)
XCAFDoc_Centroid
attribute to store centroid
Constructors(1)
class methods
Static methods(5)
- Set(label: TDF_Label, pnt: gp_Pnt): XCAFDoc_Centroid
Find, or create, a Location attribute and set it's value the Location attribute is returned.
Location methodsParameters (2)labelpnt
Returns point as argument returns false if no such attribute at the <label>.
Parameters (2)labelpnt—Mutated in place; read the updated value from this argument after the call.
- get_type_name(): string
Instance methods(7)
- Parameters (1)
pnt
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_ClippingPlaneTool
Provide tool for management of ClippingPlane section of document. Provide tool to store, retrieve, remove and modify clipping planes. Each clipping plane consists of gp_Pln and its name.
Constructors(1)
Static methods(4)
- Set(theLabel: TDF_Label): XCAFDoc_ClippingPlaneTool
Creates (if not exist) ClippingPlaneTool.
Parameters (1)theLabel
- get_type_name(): string
Instance methods(17)
returns the label under which ClippingPlanes are stored
- IsClippingPlane(theLabel: TDF_Label): boolean
Returns True if label belongs to a ClippingPlane table and is a ClippingPlane definition.
Parameters (1)theLabel
- GetClippingPlane(theLabel: TDF_Label, thePlane: gp_Pln, theName: TCollection_ExtendedString, theCapping: boolean): { returnValue: boolean; theCapping: boolean }
Returns ClippingPlane defined by label lab Returns False if the label is not in ClippingPlane table or does not define a ClippingPlane.
Parameters (4)theLabelthePlane—Mutated in place; read the updated value from this argument after the call.theName—Mutated in place; read the updated value from this argument after the call.theCapping
ReturnsA result object with fields:
returnValue: the C++ return valuetheCapping: updated value from the call.
- GetClippingPlane(theLabel: TDF_Label, thePlane: gp_Pln, theCapping: boolean): { returnValue: boolean; theName: TCollection_HAsciiString; theCapping: boolean; [Symbol.dispose](): void }
Returns ClippingPlane defined by label lab Returns False if the label is not in ClippingPlane table or does not define a ClippingPlane.
Parameters (3)theLabelthePlane—Mutated in place; read the updated value from this argument after the call.theCapping
ReturnsA result object with fields:
returnValue: the C++ return valuetheName: owned by the returned envelope.theCapping: updated value from the call.
Dispose the returned envelope to release owned Handle fields.
- AddClippingPlane(thePlane: gp_Pln, theName: TCollection_ExtendedString): TDF_Label
Adds a clipping plane definition to a ClippingPlane table and returns its label (returns existing label if the same clipping plane is already defined).
Parameters (2)thePlanetheName
- AddClippingPlane(thePlane: gp_Pln, theName: TCollection_HAsciiString): TDF_Label
Adds a clipping plane definition to a ClippingPlane table and returns its label (returns existing label if the same clipping plane is already defined).
Parameters (2)thePlanetheName
- AddClippingPlane(thePlane: gp_Pln, theName: TCollection_ExtendedString, theCapping: boolean): TDF_Label
Adds a clipping plane definition to a ClippingPlane table and returns its label (returns existing label if the same clipping plane is already defined).
Parameters (3)thePlanetheNametheCapping
- AddClippingPlane(thePlane: gp_Pln, theName: TCollection_HAsciiString, theCapping: boolean): TDF_Label
Adds a clipping plane definition to a ClippingPlane table and returns its label (returns existing label if the same clipping plane is already defined).
Parameters (3)thePlanetheNametheCapping
- RemoveClippingPlane(theLabel: TDF_Label): boolean
Removes clipping plane from the ClippingPlane table Return false and do nothing if clipping plane is referenced in at least one View.
Parameters (1)theLabel
- GetClippingPlanes(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of clipping planes currently stored in the ClippingPlane table.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- UpdateClippingPlane(theLabelL: TDF_Label, thePlane: gp_Pln, theName: TCollection_ExtendedString): void
Sets new value of plane and name to the given clipping plane label or do nothing, if the given label is not a clipping plane label.
Parameters (3)theLabelLthePlanetheName
- SetCapping(theClippingPlaneL: TDF_Label, theCapping: boolean): void
Set new value of capping for given clipping plane label.
Parameters (2)theClippingPlaneLtheCapping
- GetCapping(theClippingPlaneL: TDF_Label): boolean
Get capping value for given clipping plane label Return capping value.
Parameters (1)theClippingPlaneL
- GetCapping(theClippingPlaneL: TDF_Label, theCapping: boolean): { returnValue: boolean; theCapping: boolean }
Get capping value for given clipping plane label Return true if Label is valid and capping exists.
Parameters (2)theClippingPlaneLtheCapping
ReturnsA result object with fields:
returnValue: the C++ return valuetheCapping: updated value from the call.
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_Color
attribute to store color
Constructors(1)
Static methods(7)
- Set(label: TDF_Label, C: Quantity_Color): XCAFDoc_ColorParameters (2)
labelC
- Set(label: TDF_Label, C: Quantity_ColorRGBA): XCAFDoc_ColorParameters (2)
labelC
- Set(label: TDF_Label, C: Quantity_NameOfColor): XCAFDoc_ColorParameters (2)
labelC
- Set(label: TDF_Label, R: number, G: number, B: number, alpha: number): XCAFDoc_Color
Find, or create, a Color attribute and set it's value the Color attribute is returned.
Parameters (5)labelRGBalpha
- get_type_name(): string
Instance methods(14)
- Set(C: Quantity_Color): voidParameters (1)
C
- Set(C: Quantity_ColorRGBA): voidParameters (1)
C
- Set(C: Quantity_NameOfColor): voidParameters (1)
C
- Set(R: number, G: number, B: number, alpha: number): voidParameters (4)
RGBalpha
- GetRGB(R: number, G: number, B: number): { R: number; G: number; B: number }Parameters (3)
RGB
- GetAlpha(): number
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_ColorTool
Provides tools to store and retrieve attributes (colors) of TopoDS_Shape in and from TDocStd_Document A Document is intended to hold different attributes of ONE shape and it's sub-shapes Provide tools for management of Colors section of document.
Constructors(1)
Static methods(12)
- AutoNaming(): boolean
Returns current auto-naming mode; TRUE by default. If TRUE then for added colors the
TDataStd_Nameattribute will be automatically added. This setting is global. - SetAutoNaming(theIsAutoNaming: boolean): void
See also
AutoNaming().Parameters (1)theIsAutoNaming
Creates (if not exist) ColorTool.
Parameters (1)L
- GetColor(lab: TDF_Label, col: Quantity_Color): boolean
Returns color defined by label lab Returns False if the label is not in colortable or does not define a color.
Parameters (2)labcol—Mutated in place; read the updated value from this argument after the call.
- GetColor(lab: TDF_Label, col: Quantity_ColorRGBA): boolean
Returns color defined by label lab Returns False if the label is not in colortable or does not define a color.
Parameters (2)labcol—Mutated in place; read the updated value from this argument after the call.
- GetColor(L: TDF_Label, type_: XCAFDoc_ColorType, colorL: TDF_Label): boolean
Returns label with color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Ltype_colorL—Mutated in place; read the updated value from this argument after the call.
- GetColor(L: TDF_Label, type_: XCAFDoc_ColorType, color: Quantity_Color): boolean
Returns color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Ltype_color—Mutated in place; read the updated value from this argument after the call.
- GetColor(L: TDF_Label, type_: XCAFDoc_ColorType, color: Quantity_ColorRGBA): boolean
Returns color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Ltype_color—Mutated in place; read the updated value from this argument after the call.
Return TRUE if object on this label is visible, FALSE if invisible.
Parameters (1)L
- get_type_name(): string
Instance methods(36)
returns the label under which colors are stored
Returns internal
XCAFDoc_ShapeTooltool.Returns True if label belongs to a colortable and is a color definition.
Parameters (1)lab
- GetColor(S: TopoDS_Shape, type_: XCAFDoc_ColorType, colorL: TDF_Label): boolean
Returns label with color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Stype_colorL—Mutated in place; read the updated value from this argument after the call.
- GetColor(S: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_Color): boolean
Returns color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Stype_color—Mutated in place; read the updated value from this argument after the call.
- GetColor(S: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_ColorRGBA): boolean
Returns color assigned to <L> as <type> Returns False if no such color is assigned.
Parameters (3)Stype_color—Mutated in place; read the updated value from this argument after the call.
- FindColor(col: Quantity_Color): TDF_Label
Finds a color definition in a colortable and returns its label if found (or Null label else).
Parameters (1)col
- FindColor(col: Quantity_ColorRGBA): TDF_Label
Finds a color definition in a colortable and returns its label if found (or Null label else).
Parameters (1)col
- FindColor(col: Quantity_Color, lab: TDF_Label): boolean
Finds a color definition in a colortable and returns its label if found Returns False if color is not found in colortable.
Parameters (2)collab—Mutated in place; read the updated value from this argument after the call.
- FindColor(col: Quantity_ColorRGBA, lab: TDF_Label): boolean
Finds a color definition in a colortable and returns its label if found Returns False if color is not found in colortable.
Parameters (2)collab—Mutated in place; read the updated value from this argument after the call.
- AddColor(col: Quantity_Color): TDF_Label
Adds a color definition to a colortable and returns its label (returns existing label if the same color is already defined).
Parameters (1)col
- AddColor(col: Quantity_ColorRGBA): TDF_Label
Adds a color definition to a colortable and returns its label (returns existing label if the same color is already defined).
Parameters (1)col
- RemoveColor(lab: TDF_Label): void
Removes color from the colortable.
Parameters (1)lab
- GetColors(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of colors currently stored in the colortable.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- SetColor(L: TDF_Label, colorL: TDF_Label, type_: XCAFDoc_ColorType): void
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color defined by <colorL>. Color of shape is defined following way in dependance with type of color. If type of color is XCAFDoc_ColorGen - then this color defines default color for surfaces and curves. If for shape color with types XCAFDoc_ColorSurf or XCAFDoc_ColorCurv is specified then such color overrides generic color.Parameters (3)LcolorLtype_
- SetColor(L: TDF_Label, Color: Quantity_Color, type_: XCAFDoc_ColorType): void
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color <Color> in the colortable Adds a color as necessary.Parameters (3)LColortype_
- SetColor(L: TDF_Label, Color: Quantity_ColorRGBA, type_: XCAFDoc_ColorType): void
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color <Color> in the colortable Adds a color as necessary.Parameters (3)LColortype_
- SetColor(S: TopoDS_Shape, colorL: TDF_Label, type_: XCAFDoc_ColorType): boolean
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color defined by <colorL> Returns False if cannot find a label for shape S.Parameters (3)ScolorLtype_
- SetColor(S: TopoDS_Shape, Color: Quantity_Color, type_: XCAFDoc_ColorType): boolean
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color <Color> in the colortable Adds a color as necessary Returns False if cannot find a label for shape S.Parameters (3)SColortype_
- SetColor(S: TopoDS_Shape, Color: Quantity_ColorRGBA, type_: XCAFDoc_ColorType): boolean
Sets a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color <Color> in the colortable Adds a color as necessary Returns False if cannot find a label for shape S.Parameters (3)SColortype_
- UnSetColor(L: TDF_Label, type_: XCAFDoc_ColorType): void
Removes a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color.Parameters (2)Ltype_
- UnSetColor(S: TopoDS_Shape, type_: XCAFDoc_ColorType): boolean
Removes a link with GUID defined by <type> (see
XCAFDoc::ColorRefGUID()) from label <L> to color Returns True if such link existed.Parameters (2)Stype_
- IsSet(L: TDF_Label, type_: XCAFDoc_ColorType): boolean
Returns True if label <L> has a color assignment of the type <type>.
Parameters (2)Ltype_
- IsSet(S: TopoDS_Shape, type_: XCAFDoc_ColorType): boolean
Returns True if label <L> has a color assignment of the type <type>.
Parameters (2)Stype_
- SetVisibility(shapeLabel: TDF_Label, isvisible?: boolean): void
Set the visibility of object on label. Do nothing if there no any object. Set UAttribute with corresponding GUID.
Parameters (2)shapeLabelisvisible
- IsColorByLayer(L: TDF_Label): boolean
Return TRUE if object color defined by its Layer, FALSE if not.
Parameters (1)L
- SetColorByLayer(shapeLabel: TDF_Label, isColorByLayer?: boolean): void
Set the Color defined by Layer flag on label. Do nothing if there no any object. Set UAttribute with corresponding GUID.
Parameters (2)shapeLabelisColorByLayer
- SetInstanceColor(theShape: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_Color, isCreateSHUO: boolean): boolean
Sets the color of component that styled with SHUO structure Returns FALSE if no sush component found NOTE: create SHUO structeure if it is necessary and if <isCreateSHUO>.
Parameters (4)theShapetype_colorisCreateSHUO
- SetInstanceColor(theShape: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_ColorRGBA, isCreateSHUO: boolean): boolean
Sets the color of component that styled with SHUO structure Returns FALSE if no sush component found NOTE: create SHUO structeure if it is necessary and if <isCreateSHUO>.
Parameters (4)theShapetype_colorisCreateSHUO
- GetInstanceColor(theShape: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_Color): boolean
Gets the color of component that styled with SHUO structure Returns FALSE if no sush component or color type.
Parameters (3)theShapetype_color—Mutated in place; read the updated value from this argument after the call.
- GetInstanceColor(theShape: TopoDS_Shape, type_: XCAFDoc_ColorType, color: Quantity_ColorRGBA): boolean
Gets the color of component that styled with SHUO structure Returns FALSE if no sush component or color type.
Parameters (3)theShapetype_color—Mutated in place; read the updated value from this argument after the call.
- IsInstanceVisible(theShape: TopoDS_Shape): boolean
Gets the visibility status of component that styled with SHUO structure Returns FALSE if no sush component.
Parameters (1)theShape
- ReverseChainsOfTreeNodes(): boolean
Reverses order in chains of TreeNodes (from Last to First) under each Color Label since we became to use function ::Prepend() instead of ::Append() in method
SetColor()for acceleration. - ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_ColorType
Properties(3)
XCAFDoc_Datum
attribute to store datum
Constructors(1)
Static methods(5)
- Set(label: TDF_Label, aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, anIdentification: TCollection_HAsciiString): XCAFDoc_DatumParameters (4)
labelaNameaDescriptionanIdentification
- Set(theLabel: TDF_Label): XCAFDoc_DatumParameters (1)
theLabel
- get_type_name(): string
Instance methods(11)
- Set(aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, anIdentification: TCollection_HAsciiString): voidParameters (3)
aNameaDescriptionanIdentification
Returns dimension object data taken from the paren's label and its sub-labels.
- SetObject(theDatumObject: XCAFDimTolObjects_DatumObject): void
Updates parent's label and its sub-labels with data taken from theDatumObject. Old data associated with the label will be lost.
Parameters (1)theDatumObject
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_Dimension
Attribute that identifies a dimension in the GD&T table. Its parent label is used as a container to store data provided by XCAFDimTolObjects_DimensionObject.
Constructors(1)
Static methods(4)
- Set(theLabel: TDF_Label): XCAFDoc_DimensionParameters (1)
theLabel
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Returns the ID of the attribute.
- SetObject(theDimensionObject: XCAFDimTolObjects_DimensionObject): void
Updates parent's label and its sub-labels with data taken from theDimensionObject. Old data associated with the label will be lost.
Parameters (1)theDimensionObject
Returns dimension object data taken from the parent's label and its sub-labels.
XCAFDoc_DimTol
attribute to store dimension and tolerance
Constructors(1)
Static methods(4)
- Set(label: TDF_Label, kind: number, aVal: NCollection_HArray1_double, aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString): XCAFDoc_DimTolParameters (5)
labelkindaValaNameaDescription
- get_type_name(): string
Instance methods(10)
- Set(kind: number, aVal: NCollection_HArray1_double, aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString): voidParameters (4)
kindaValaNameaDescription
- GetKind(): number
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_DimTolTool
Attribute containing GD&T section of XCAF document. Provide tools for GD&T section management.
Constructors(1)
Static methods(7)
Creates (if not exist) DimTolTool attribute.
Parameters (1)L
Returns the standard GD&T tool GUID.
- GetRefShapeLabel(theL: TDF_Label, theShapeLFirst: NCollection_Sequence_TDF_Label, theShapeLSecond: NCollection_Sequence_TDF_Label): boolean
Gets all shape labels referred by theL label of the GD&T table. Returns False if there are no shape labels added to the sequences.
Parameters (3)theLtheShapeLFirst—Mutated in place; read the updated value from this argument after the call.theShapeLSecond—Mutated in place; read the updated value from this argument after the call.
- GetDatumOfTolerLabels(theDimTolL: TDF_Label, theDatums: NCollection_Sequence_TDF_Label): boolean
Returns all Datum labels defined for theDimTolL label.
Parameters (2)theDimTolLtheDatums—Mutated in place; read the updated value from this argument after the call.
- GetDatumWithObjectOfTolerLabels(theDimTolL: TDF_Label, theDatums: NCollection_Sequence_TDF_Label): boolean
Returns all Datum labels with
XCAFDimTolObjects_DatumObjectdefined for label theDimTolL.Parameters (2)theDimTolLtheDatums—Mutated in place; read the updated value from this argument after the call.
- get_type_name(): string
Instance methods(42)
Returns the label under which GD&T table is stored.
Returns internal
XCAFDoc_ShapeTooltool.- IsDimension(theLab: TDF_Label): boolean
Returns True if the label belongs to a GD&T table and is a Dimension definition.
Parameters (1)theLab
- GetDimensionLabels(theLabels: NCollection_Sequence_TDF_Label): void
Returns a sequence of Dimension labels currently stored in the GD&T table.
Parameters (1)theLabels—Mutated in place; read the updated value from this argument after the call.
- SetDimension(theL: TDF_Label, theDimL: TDF_Label): void
Sets a dimension to the target label.
Parameters (2)theLtheDimL
- SetDimension(theFirstLS: NCollection_Sequence_TDF_Label, theSecondLS: NCollection_Sequence_TDF_Label, theDimL: TDF_Label): void
Sets a dimension to sequences target labels.
Parameters (3)theFirstLStheSecondLStheDimL
- SetDimension(theFirstL: TDF_Label, theSecondL: TDF_Label, theDimL: TDF_Label): void
Sets a dimension to target labels.
Parameters (3)theFirstLtheSecondLtheDimL
- GetRefDimensionLabels(theShapeL: TDF_Label, theDimensions: NCollection_Sequence_TDF_Label): boolean
Returns all Dimension labels defined for theShapeL.
Parameters (2)theShapeLtheDimensions—Mutated in place; read the updated value from this argument after the call.
Adds a dimension definition to the GD&T table and returns its label.
- IsGeomTolerance(theLab: TDF_Label): boolean
Returns True if the label belongs to the GD&T table and is a dimension tolerance.
Parameters (1)theLab
- GetGeomToleranceLabels(theLabels: NCollection_Sequence_TDF_Label): void
Returns a sequence of Tolerance labels currently stored in the GD&T table.
Parameters (1)theLabels—Mutated in place; read the updated value from this argument after the call.
- SetGeomTolerance(theL: TDF_Label, theGeomTolL: TDF_Label): void
Sets a geometry tolerance from theGeomTolL to theL label. Checks if theGeomTolL is a geometry tolerance definition first.
Parameters (2)theLtheGeomTolL
- SetGeomTolerance(theL: NCollection_Sequence_TDF_Label, theGeomTolL: TDF_Label): void
Sets a geometry tolerance from theGeomTolL to sequence of labels theL. Checks if theGeomTolL is a geometry tolerance definition first.
Parameters (2)theLtheGeomTolL
- GetRefGeomToleranceLabels(theShapeL: TDF_Label, theDimTols: NCollection_Sequence_TDF_Label): boolean
Returns all GeomTolerance labels defined for theShapeL.
Parameters (2)theShapeLtheDimTols—Mutated in place; read the updated value from this argument after the call.
Adds a GeomTolerance definition to the GD&T table and returns its label.
Returns True if theLab belongs to the GD&T table and is a dmension tolerance.
Parameters (1)theLab
- GetDimTolLabels(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of D>s currently stored in the GD&T table.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- FindDimTol(theKind: number, theVal: NCollection_HArray1_double, theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString, lab: TDF_Label): boolean
Finds a dimension tolerance definition in the GD&T table satisfying the specified kind, values, name and description and returns its label if found. Returns False if dimension tolerance is not found in DGTtable.
Parameters (5)theKindtheValtheNametheDescriptionlab—Mutated in place; read the updated value from this argument after the call.
- FindDimTol(theKind: number, theVal: NCollection_HArray1_double, theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString): TDF_Label
Finds a dimension tolerance in the GD&T table satisfying the specified kind, values, name and description and returns its label if found (or Null label else).
Parameters (4)theKindtheValtheNametheDescription
- AddDimTol(theKind: number, theVal: NCollection_HArray1_double, theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString): TDF_Label
Adds a dimension tolerance definition with the specified kind, value, name and description to the GD&T table and returns its label.
Parameters (4)theKindtheValtheNametheDescription
Sets existing dimension tolerance to theL label.
Parameters (2)theLtheDimTolL
- SetDimTol(theL: TDF_Label, theKind: number, theVal: NCollection_HArray1_double, theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString): TDF_Label
Creates a dimension tolerance and sets it to theL label.
Parameters (5)theLtheKindtheValtheNametheDescription
- GetDimTol(theDimTolL: TDF_Label, theKind: number): { returnValue: boolean; theKind: number; theVal: NCollection_HArray1_double; theName: TCollection_HAsciiString; theDescription: TCollection_HAsciiString; [Symbol.dispose](): void }
Returns dimension tolerance assigned to theDimTolL label. Returns False if no such dimension tolerance is assigned.
Parameters (2)theDimTolLtheKind
ReturnsA result object with fields:
returnValue: the C++ return valuetheKind: updated value from the call.theVal: owned by the returned envelope.theName: owned by the returned envelope.theDescription: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
Returns True if label belongs to the GD&T table and is a Datum definition.
Parameters (1)lab
- GetDatumLabels(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of Datums currently stored in the GD&T table.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- FindDatum(theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString, theIdentification: TCollection_HAsciiString, lab: TDF_Label): boolean
Finds a datum satisfying the specified name, description and identification and returns its label if found.
Parameters (4)theNametheDescriptiontheIdentificationlab—Mutated in place; read the updated value from this argument after the call.
- AddDatum(theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString, theIdentification: TCollection_HAsciiString): TDF_Label
Adds a datum definition to the GD&T table and returns its label.
Parameters (3)theNametheDescriptiontheIdentification
Adds a datum definition to the GD&T table and returns its label.
- SetDatum(theShapeLabels: NCollection_Sequence_TDF_Label, theDatumL: TDF_Label): void
Sets a datum to the sequence of shape labels.
Parameters (2)theShapeLabelstheDatumL
- SetDatum(theL: TDF_Label, theTolerL: TDF_Label, theName: TCollection_HAsciiString, theDescription: TCollection_HAsciiString, theIdentification: TCollection_HAsciiString): void
Sets a datum to theL label and binds it with theTolerL label. A datum with the specified name, description and identification is created if it isn't found in the GD&T table.
Parameters (5)theLtheTolerLtheNametheDescriptiontheIdentification
- SetDatumToGeomTol(theDatumL: TDF_Label, theTolerL: TDF_Label): void
Sets a datum from theDatumL label to theToletL label.
Parameters (2)theDatumLtheTolerL
- GetDatum(theDatumL: TDF_Label): { returnValue: boolean; theName: TCollection_HAsciiString; theDescription: TCollection_HAsciiString; theIdentification: TCollection_HAsciiString; [Symbol.dispose](): void }
Returns datum assigned to theDatumL label. Returns False if no such datum is assigned.
Parameters (1)theDatumL
ReturnsA result object with fields:
returnValue: the C++ return valuetheName: owned by the returned envelope.theDescription: owned by the returned envelope.theIdentification: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- GetTolerOfDatumLabels(theDatumL: TDF_Label, theTols: NCollection_Sequence_TDF_Label): boolean
Returns all GeomToleranses labels defined for theDatumL label.
Parameters (2)theDatumLtheTols—Mutated in place; read the updated value from this argument after the call.
- GetRefDatumLabel(theShapeL: TDF_Label, theDatum: NCollection_Sequence_TDF_Label): boolean
Returns Datum label defined for theShapeL label.
Parameters (2)theShapeLtheDatum—Mutated in place; read the updated value from this argument after the call.
Returns true if the given GDT is marked as locked.
Parameters (1)theViewL
Mark the given GDT as locked.
Parameters (1)theViewL
- GetGDTPresentations(theGDTLabelToShape: NCollection_IndexedDataMap_TDF_Label_TopoDS_Shape): void
fill the map GDT label -> shape presentation
Parameters (1)theGDTLabelToShape—Mutated in place; read the updated value from this argument after the call.
- SetGDTPresentations(theGDTLabelToPrs: NCollection_IndexedDataMap_TDF_Label_TopoDS_Shape): void
Set shape presentation for GDT labels according to given map (theGDTLabelToPrs) theGDTLabelToPrsName map is an additional argument, can be used to set presentation names. If label is not in the theGDTLabelToPrsName map, the presentation name will be empty.
Parameters (1)theGDTLabelToPrs—Mutated in place; read the updated value from this argument after the call.
Unlock the given GDT.
Parameters (1)theViewL
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_DocumentTool
Defines sections structure of an XDE document. attribute marking CAF document as being DECAF document. Creates the sections structure of the document.
Constructors(1)
Static methods(37)
- Set(L: TDF_Label, IsAcces?: boolean): XCAFDoc_DocumentTool
Create (if not exist) DocumentTool attribute on 0.1 label if <IsAcces> is true, else on <L> label. This label will be returned by
DocLabel(); If the attribute is already set it won't be reset on <L> even if <IsAcces> is false. ColorTool and ShapeTool attributes are also set by this method.Parameters (2)LIsAcces
- IsXCAFDocument(Doc: TDocStd_Document): booleanParameters (1)
Doc
Returns label where the DocumentTool attribute is or 0.1 if DocumentTool is not yet set.
Parameters (1)acces
- ShapesLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 1.Parameters (1)acces
- ColorsLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 2.Parameters (1)acces
- LayersLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 3.Parameters (1)acces
Returns sub-label of
DocLabel()with tag 4.Parameters (1)acces
- MaterialsLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 5.Parameters (1)acces
- ViewsLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 7.Parameters (1)acces
- ClippingPlanesLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 8.Parameters (1)acces
- NotesLabel(acces: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 9.Parameters (1)acces
- VisMaterialLabel(theLabel: TDF_Label): TDF_Label
Returns sub-label of
DocLabel()with tag 10.Parameters (1)theLabel
- ShapeTool(acces: TDF_Label): XCAFDoc_ShapeTool
Creates (if it does not exist) ShapeTool attribute on
ShapesLabel().Parameters (1)acces
- CheckShapeTool(theAcces: TDF_Label): boolean
Checks for the ShapeTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- ColorTool(acces: TDF_Label): XCAFDoc_ColorTool
Creates (if it does not exist) ColorTool attribute on
ColorsLabel().Parameters (1)acces
- CheckColorTool(theAcces: TDF_Label): boolean
Checks for the ColorTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- VisMaterialTool(theLabel: TDF_Label): XCAFDoc_VisMaterialTool
Creates (if it does not exist)
XCAFDoc_VisMaterialToolattribute onVisMaterialLabel(). Should not be confused withMaterialTool()defining physical/manufacturing materials.Parameters (1)theLabel
- CheckVisMaterialTool(theAcces: TDF_Label): boolean
Checks for the VisMaterialTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- LayerTool(acces: TDF_Label): XCAFDoc_LayerTool
Creates (if it does not exist) LayerTool attribute on
LayersLabel().Parameters (1)acces
- CheckLayerTool(theAcces: TDF_Label): boolean
Checks for the LayerTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- DimTolTool(acces: TDF_Label): XCAFDoc_DimTolTool
Creates (if it does not exist) DimTolTool attribute on
DGTsLabel().Parameters (1)acces
- CheckDimTolTool(theAcces: TDF_Label): boolean
Checks for the DimTolTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- MaterialTool(acces: TDF_Label): XCAFDoc_MaterialTool
Creates (if it does not exist) DimTolTool attribute on
DGTsLabel().Parameters (1)acces
- CheckMaterialTool(theAcces: TDF_Label): boolean
Checks for the MaterialTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- ViewTool(acces: TDF_Label): XCAFDoc_ViewTool
Creates (if it does not exist) ViewTool attribute on
ViewsLabel().Parameters (1)acces
- CheckViewTool(theAcces: TDF_Label): boolean
Checks for the ViewTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
Creates (if it does not exist) ClippingPlaneTool attribute on
ClippingPlanesLabel().Parameters (1)acces
- CheckClippingPlaneTool(theAcces: TDF_Label): boolean
Checks for the ClippingPlaneTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- NotesTool(acces: TDF_Label): XCAFDoc_NotesTool
Creates (if it does not exist) NotesTool attribute on
NotesLabel().Parameters (1)acces
- CheckNotesTool(theAcces: TDF_Label): boolean
Checks for the NotesTool attribute on the label's document Returns TRUE if Tool exists, ELSE if it has not been created.
Parameters (1)theAcces
- GetLengthUnit(theDoc: TDocStd_Document, theResut: number, theBaseUnit: UnitsMethods_LengthUnit): { returnValue: boolean; theResut: number }
Returns value of current internal unit for the document converted to base unit type.
Parameters (3)theDoctheResuttheBaseUnit
ReturnsA result object with fields:
returnValue: the C++ return valuetheResut: updated value from the call.
- GetLengthUnit(theDoc: TDocStd_Document, theResut: number): { returnValue: boolean; theResut: number }
Returns value of current internal unit for the document in meter.
Parameters (2)theDoctheResut
ReturnsA result object with fields:
returnValue: the C++ return valuetheResut: updated value from the call.
- SetLengthUnit(theDoc: TDocStd_Document, theUnitValue: number): void
Sets value of current internal unit to the document in meter.
Parameters (2)theDoctheUnitValue
- SetLengthUnit(theDoc: TDocStd_Document, theUnitValue: number, theBaseUnit: UnitsMethods_LengthUnit): void
Sets value of current internal unit to the document.
Parameters (3)theDoctheUnitValue—must be represented in the base unit typetheBaseUnit
- get_type_name(): string
Instance methods(5)
- Init(): void
to be called when reading this attribute from file
- ID(): Standard_GUID
Returns the ID of the attribute.
- AfterRetrieval(forceIt?: boolean): boolean
To init this derived attribute after the attribute restore using the base restore-methods.
Parameters (1)forceIt
XCAFDoc_Editor
Tool for edit structure of document.
Constructors(1)
Static methods(10)
Converts shape (compound/compsolid/shell/wire) to assembly.
Parameters (3)theDoc—input documenttheShape—input shape labeltheRecursively—recursively expand a compound subshape
ReturnsTrue if shape successfully expanded
Converts all compounds shapes in the document to assembly.
Parameters (2)theDoc—input documenttheRecursively—recursively expand a compound subshape
ReturnsTrue if shape successfully expanded
- Extract(theSrcLabels: NCollection_Sequence_TDF_Label, theDstLabel: TDF_Label, theIsNoVisMat: boolean): boolean
Clones all labels to a new position, keeping the structure with all the attributes.
Parameters (3)theSrcLabels—original labels to copy fromtheDstLabel—label to set result as a component of or a main document's label to simply set new shapetheIsNoVisMat—get a VisMaterial attributes as is or convert to color
ReturnsTrue if shape successfully extracted
Clones the label to a new position, keeping the structure with all the attributes.
Parameters (3)theSrcLabel—original label to copy fromtheDstLabel—label to set result as a component of or a main document's label to simply set new shapetheIsNoVisMat—get a VisMaterial attributes as is or convert to color
ReturnsTrue if shape successfully extracted
- CloneShapeLabel(theSrcLabel: TDF_Label, theSrcShapeTool: XCAFDoc_ShapeTool, theDstShapeTool: XCAFDoc_ShapeTool, theMap: NCollection_DataMap_TDF_Label_TDF_Label): TDF_Label
Copies shapes label with keeping of shape structure (recursively).
Parameters (4)theSrcLabel—original label to copy fromtheSrcShapeTool—shape tool to gettheDstShapeTool—shape tool to settheMap—relating map of the original shapes label and labels created from them Mutated in place; read the updated value from this argument after the call.
Returnsresult shape label
- CloneMetaData(theSrcLabel: TDF_Label, theDstLabel: TDF_Label, theVisMatMap: NCollection_DataMap_handle_XCAFDoc_VisMaterial_handle_XCAFDoc_VisMaterial, theToCopyColor?: boolean, theToCopyLayer?: boolean, theToCopyMaterial?: boolean, theToCopyVisMaterial?: boolean, theToCopyAttributes?: boolean): void
Copies metadata contains from the source label to the destination label. Protected against creating a new label for non-existent tools.
Parameters (8)theSrcLabel—original label to copy fromtheDstLabel—destination shape label to set attributestheVisMatMap—relating map of the original VisMaterial and created. Can be NULL for the same documenttheToCopyColor—copying visible value and shape color (handled all color type)theToCopyLayer—copying layertheToCopyMaterial—copying materialtheToCopyVisMaterial—copying visual materialtheToCopyAttributes—copying of other node attributes, for example, a shape's property
- GetParentShapeLabels(theLabel: TDF_Label, theRelatedLabels: NCollection_Map_TDF_Label): void
Gets shape labels that has down relation with the input label.
Parameters (2)theLabel—input labeltheRelatedLabels—output labels Mutated in place; read the updated value from this argument after the call.
- GetChildShapeLabels(theLabel: TDF_Label, theRelatedLabels: NCollection_Map_TDF_Label): void
Gets shape labels that has up relation with the input label.
Parameters (2)theLabel—input labeltheRelatedLabels—output labels Mutated in place; read the updated value from this argument after the call.
- FilterShapeTree(theShapeTool: XCAFDoc_ShapeTool, theLabelsToKeep: NCollection_Map_TDF_Label): boolean
Filters original shape tree with keeping structure. The result will include the full label hierarchy lower then input labels. Any higher hierarchy labels will be filtered to keep only necessary labels. All not related shape labels with input will be cleared (all attributes will be removed).
The result impact directly into original document and existed shape labels. Attributes related to removed shape can became invalide. For example, GDT with relation on removed shape label(s) and without attachment point(s) became invalid for visualization.Parameters (2)theShapeTool—shape tool to extract fromtheLabelsToKeep—labels to keep
Returnstrue if the tree was filtered successfully.
- RescaleGeometry(theLabel: TDF_Label, theScaleFactor: number, theForceIfNotRoot?: boolean): boolean
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 (3)theLabel—starting labeltheScaleFactor—scale factor, should be positivetheForceIfNotRoot—allows scaling of a non root assembly if true, otherwise - returns false
Returnstrue in case of success, otherwise - false.
XCAFDoc_GeomTolerance
Attribute to store dimension and tolerance.
Constructors(1)
Static methods(4)
- Set(theLabel: TDF_Label): XCAFDoc_GeomToleranceParameters (1)
theLabel
- get_type_name(): string
Instance methods(5)
- SetObject(theGeomToleranceObject: XCAFDimTolObjects_GeomToleranceObject): void
Updates parent's label and its sub-labels with data taken from theGeomToleranceObject. Old data associated with the label will be lost.
Parameters (1)theGeomToleranceObject
Returns geometry tolerance object data taken from the paren's label and its sub-labels.
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_GraphNode
This attribute allow user multirelation tree of labels. This GraphNode is experimental Graph that not control looping and redundance. Attribute containing sequence of father's and child's labels. Provide create and work with Graph in XCAFDocument.
Constructors(1)
Static methods(6)
- Find(L: TDF_Label): { returnValue: boolean; G: XCAFDoc_GraphNode; [Symbol.dispose](): void }
class methods working on the node
Shortcut to search a Graph node attribute with default GraphID. Returns true if found.Parameters (1)L
ReturnsA result object with fields:
returnValue: the C++ return valueG: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
Finds or Creates a GraphNode attribute on the label <L> with the default Graph ID, returned by the method <GetDefaultGraphID>. Returns the created/found GraphNode attribute.
Parameters (1)L
- Set(L: TDF_Label, ExplicitGraphID: Standard_GUID): XCAFDoc_GraphNode
Finds or Creates a GraphNode attribute on the label <L>, with an explicit tree ID. <ExplicitGraphID> is the ID returned by <
TDF_Attribute::ID> method. Returns the found/created GraphNode attribute.Parameters (2)LExplicitGraphID
returns a default Graph ID. this ID is used by the <Set> method without explicit tree ID.
Instance methods:- get_type_name(): string
Instance methods(22)
- SetGraphID(explicitID: Standard_GUID): voidParameters (1)
explicitID
- SetFather(F: XCAFDoc_GraphNode): number
Set GraphNode <F> as father of me and returns index of <F> in Sequence that containing Fathers GraphNodes. return index of <F> from GraphNodeSequnece.
Parameters (1)F
- SetChild(Ch: XCAFDoc_GraphNode): number
Set GraphNode <Ch> as child of me and returns index of <Ch> in Sequence that containing Children GraphNodes. return index of <Ch> from GraphNodeSequnece.
Parameters (1)Ch
- UnSetFather(F: XCAFDoc_GraphNode): void
Remove <F> from Fathers GraphNodeSequence. and remove link between father and child.
Parameters (1)F
- UnSetFather(Findex: number): void
Remove Father GraphNode by index from Fathers GraphNodeSequence. and remove link between father and child.
Parameters (1)Findex
- UnSetChild(Ch: XCAFDoc_GraphNode): void
Remove <Ch> from GraphNodeSequence. and remove link between father and child.
Parameters (1)Ch
- UnSetChild(Chindex: number): void
Remove Child GraphNode by index from Children GraphNodeSequence. and remove link between father and child.
Parameters (1)Chindex
- GetFather(Findex: number): XCAFDoc_GraphNode
Return GraphNode by index from GraphNodeSequence.
Parameters (1)Findex
- GetChild(Chindex: number): XCAFDoc_GraphNode
Return GraphNode by index from GraphNodeSequence.
Parameters (1)Chindex
- FatherIndex(F: XCAFDoc_GraphNode): number
Return index of <F>, or zero if there is no such Graphnode.
Parameters (1)F
- ChildIndex(Ch: XCAFDoc_GraphNode): number
Return index of <Ch>, or zero if there is no such Graphnode.
Parameters (1)Ch
- IsFather(Ch: XCAFDoc_GraphNode): boolean
returns TRUE if <me> is father of <Ch>.
Parameters (1)Ch
- IsChild(F: XCAFDoc_GraphNode): boolean
returns TRUE if <me> is child of <F>.
Parameters (1)F
- NbFathers(): number
return Number of Fathers GraphNodes.
- NbChildren(): number
return Number of Childrens GraphNodes.
Implementation of Attribute methods: - ID(): Standard_GUID
Returns the Graph ID (default or explicit one depending on the Set method used).
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- References(aDataSet: TDF_DataSet): void
Adds the first level referenced attributes and labels to <aDataSet>.
For this, use the AddLabel or AddAttribute of DataSet.
If there is none, do not implement the method.Parameters (1)aDataSet
- BeforeForget(): void
Something to do before forgetting an Attribute to a label.
XCAFDoc_LayerTool
Provides tools to store and retrieve attributes (Layers) of TopoDS_Shape in and from TDocStd_Document A Document is intended to hold different attributes of ONE shape and it's sub-shapes Provide tools for management of Layers section of document.
Constructors(1)
Static methods(5)
Creates (if not exist) LayerTool.
Parameters (1)L
- GetShapesOfLayer(theLayerL: TDF_Label, theShLabels: NCollection_Sequence_TDF_Label): void
Return sequanese of shape labels that assigned with layers to <ShLabels>.
Parameters (2)theLayerLtheShLabels—Mutated in place; read the updated value from this argument after the call.
- get_type_name(): string
Instance methods(37)
returns the label under which Layers are stored
Returns internal
XCAFDoc_ShapeTooltool.Returns True if label belongs to a Layertable and is a Layer definition.
Parameters (1)lab
- GetLayer(lab: TDF_Label, aLayer: TCollection_ExtendedString): boolean
Returns Layer defined by label lab Returns False if the label is not in Layertable or does not define a Layer.
Parameters (2)labaLayer—Mutated in place; read the updated value from this argument after the call.
- FindLayer(aLayer: TCollection_ExtendedString, lab: TDF_Label): boolean
Finds a Layer definition in a Layertable and returns its label if found Returns False if Layer is not found in Layertable.
Parameters (2)aLayerlab—Mutated in place; read the updated value from this argument after the call.
- FindLayer(aLayer: TCollection_ExtendedString, theToFindWithProperty: boolean, theToFindVisible: boolean): TDF_Label
Finds a Layer definition in a Layertable by name Returns first founded label with the same name if <theToFindWithProperty> is false If <theToFindWithProperty> is true returns first label that contains or not contains visible attr, according to the <theToFindVisible> parameter.
Parameters (3)aLayertheToFindWithPropertytheToFindVisible
- AddLayer(theLayer: TCollection_ExtendedString): TDF_Label
Adds a Layer definition to a Layertable and returns its label (returns existing label if the same Layer is already defined).
Parameters (1)theLayer
- AddLayer(theLayer: TCollection_ExtendedString, theToFindVisible: boolean): TDF_Label
Adds a Layer definition to a Layertable and returns its label Returns existing label (if it is already defined) of visible or invisible layer, according to <theToFindVisible> parameter.
Parameters (2)theLayertheToFindVisible
- RemoveLayer(lab: TDF_Label): void
Removes Layer from the Layertable.
Parameters (1)lab
- GetLayerLabels(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of Layers currently stored in the Layertable.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
Sets a link from label <L> to Layer defined by <LayerL> optional parameter <shapeInOneLayer> show could shape be in number of layers or only in one.
Parameters (3)LLayerLshapeInOneLayer
- SetLayer(L: TDF_Label, aLayer: TCollection_ExtendedString, shapeInOneLayer: boolean): void
Sets a link from label <L> to Layer <aLayer> in the Layertable Adds a Layer as necessary optional parameter <shapeInOneLayer> show could shape be in number of layers or only in one.
Parameters (3)LaLayershapeInOneLayer
- SetLayer(Sh: TopoDS_Shape, LayerL: TDF_Label, shapeInOneLayer: boolean): boolean
Sets a link from label that containing shape <Sh> with layer that situated at label <LayerL>. optional parameter <shapeInOneLayer> show could shape be in number of layers or only in one. return FALSE if no such shape <Sh> or label <LayerL>.
Parameters (3)ShLayerLshapeInOneLayer
- SetLayer(Sh: TopoDS_Shape, aLayer: TCollection_ExtendedString, shapeInOneLayer: boolean): boolean
Sets a link from label that containing shape <Sh> with layer <aLayer>. Add <aLayer> to LayerTable if nessesery. optional parameter <shapeInOneLayer> show could shape be in number of layers or only in one. return FALSE if no such shape <Sh>.
Parameters (3)ShaLayershapeInOneLayer
- UnSetLayers(L: TDF_Label): void
Removes a link from label <L> to all layers.
Parameters (1)L
- UnSetLayers(Sh: TopoDS_Shape): boolean
Remove link between shape <Sh> and all Layers at LayerTable. return FALSE if no such shape <Sh> in XCAF Document.
Parameters (1)Sh
- UnSetOneLayer(L: TDF_Label, aLayer: TCollection_ExtendedString): boolean
Remove link from label <L> and Layer <aLayer>. returns FALSE if no such layer.
Parameters (2)LaLayer
- UnSetOneLayer(L: TDF_Label, aLayerL: TDF_Label): boolean
Remove link from label <L> and Layer <aLayerL>. returns FALSE if <aLayerL> is not a layer label.
Parameters (2)LaLayerL
- UnSetOneLayer(Sh: TopoDS_Shape, aLayer: TCollection_ExtendedString): boolean
Remove link between shape <Sh> and layer <aLayer>. returns FALSE if no such layer <aLayer> or shape <Sh>.
Parameters (2)ShaLayer
- UnSetOneLayer(Sh: TopoDS_Shape, aLayerL: TDF_Label): boolean
Remove link between shape <Sh> and layer <aLayerL>. returns FALSE if no such layer <aLayerL> or shape <Sh>.
Parameters (2)ShaLayerL
- IsSet(L: TDF_Label, aLayer: TCollection_ExtendedString): boolean
Returns True if label <L> has a Layer associated with the <aLayer>.
Parameters (2)LaLayer
Returns True if label <L> has a Layer associated with the <aLayerL> label.
Parameters (2)LaLayerL
- IsSet(Sh: TopoDS_Shape, aLayer: TCollection_ExtendedString): boolean
Returns True if shape <Sh> has a Layer associated with the <aLayer>.
Parameters (2)ShaLayer
- IsSet(Sh: TopoDS_Shape, aLayerL: TDF_Label): boolean
Returns True if shape <Sh> has a Layer associated with the <aLayerL>.
Parameters (2)ShaLayerL
- GetLayers(L: TDF_Label): { returnValue: boolean; aLayerS: NCollection_HSequence_TCollection_ExtendedString; [Symbol.dispose](): void }
Return sequence of strings <aLayerS> that associated with label <L>.
Parameters (1)L
ReturnsA result object with fields:
returnValue: the C++ return valueaLayerS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- GetLayers_1(L: TDF_Label): { returnValue: boolean; aLayerS: NCollection_HSequence_TCollection_ExtendedString; [Symbol.dispose](): void }
Return sequence of strings <aLayerS> that associated with label <L>.
Parameters (1)L
ReturnsA result object with fields:
returnValue: the C++ return valueaLayerS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
Return sequence of strings that associated with shape <Sh>.
Parameters (1)L
- GetLayers(Sh: TopoDS_Shape): { returnValue: boolean; aLayerS: NCollection_HSequence_TCollection_ExtendedString; [Symbol.dispose](): void }
Return sequence of strings <aLayerS> that associated with shape <Sh>.
Parameters (1)Sh
ReturnsA result object with fields:
returnValue: the C++ return valueaLayerS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- GetLayers_4(Sh: TopoDS_Shape): { returnValue: boolean; aLayerS: NCollection_HSequence_TCollection_ExtendedString; [Symbol.dispose](): void }
Return sequence of strings <aLayerS> that associated with shape <Sh>.
Parameters (1)Sh
ReturnsA result object with fields:
returnValue: the C++ return valueaLayerS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
Return sequence of strings that associated with shape <Sh>.
Parameters (1)Sh
- GetLayers(L: TDF_Label, aLayerLS: NCollection_Sequence_TDF_Label): boolean
Return sequence of strings <aLayerS> that associated with label <L>.
Parameters (2)LaLayerLS—Mutated in place; read the updated value from this argument after the call.
- GetLayers(Sh: TopoDS_Shape, aLayerLS: NCollection_Sequence_TDF_Label): boolean
Return sequence of labels <aLayerSL> that associated with label <L>.
Parameters (2)ShaLayerLS—Mutated in place; read the updated value from this argument after the call.
Return TRUE if layer is visible, FALSE if invisible.
Parameters (1)layerL
- SetVisibility(layerL: TDF_Label, isvisible?: boolean): void
Set the visibility of layer. If layer is invisible when on it's layer will set UAttribute with corresponding GUID.
Parameters (2)layerLisvisible
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_LengthUnit
Used to define a Length Unit attribute containing a length unit info.
Constructors(1)
Static methods(6)
Returns the GUID of the attribute.
- Set(theLabel: TDF_Label, theUnitValue: number): XCAFDoc_LengthUnit
Finds or creates a LengthUnit attribute.
Parameters (2)theLabeltheUnitValue—- length scale factor to meter The LengthUnit attribute is returned.
- Set(theLabel: TDF_Label, theUnitName: TCollection_AsciiString, theUnitValue: number): XCAFDoc_LengthUnit
Finds or creates a LengthUnit attribute.
Parameters (3)theLabeltheUnitName—- name of the unit: mm, m, cm, km, micron, in, min, nin, ft, stat.mile
theUnitValue—- length scale factor to meter The LengthUnit attribute is returned.
- Set(theLabel: TDF_Label, theGUID: Standard_GUID, theUnitName: TCollection_AsciiString, theUnitValue: number): XCAFDoc_LengthUnit
Finds, or creates, a LengthUnit attribute with explicit user defined GUID.
Parameters (4)theLabeltheGUIDtheUnitName—- name of the unit: mm, m, cm, km, micron, in, min, nin, ft, stat.mile
theUnitValue—- length scale factor to meter The LengthUnit attribute is returned
- get_type_name(): string
Instance methods(9)
- Set(theUnitName: TCollection_AsciiString, theUnitValue: number): void
Creates a LengthUnit attribute.
Parameters (2)theUnitName—- name of the unit: mm, m, cm, km, micron, in, min, nin, ft, stat.mile
theUnitValue—- length scale factor to meter
Length unit description (could be arbitrary text).
- GetUnitValue(): number
Returns length unit scale factor to meter.
- IsEmpty(): boolean
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_Location
attribute to store TopLoc_Location
Constructors(1)
class methods
Static methods(4)
- Set(label: TDF_Label, Loc: TopLoc_Location): XCAFDoc_Location
Find, or create, a Location attribute and set it's value the Location attribute is returned.
Location methodsParameters (2)labelLoc
- get_type_name(): string
Instance methods(7)
- Set(Loc: TopLoc_Location): voidParameters (1)
Loc
Returns True if there is a reference on the same label.
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_Material
attribute to store material
Constructors(1)
Static methods(4)
- Set(label: TDF_Label, aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, aDensity: number, aDensName: TCollection_HAsciiString, aDensValType: TCollection_HAsciiString): XCAFDoc_MaterialParameters (6)
labelaNameaDescriptionaDensityaDensNameaDensValType
- get_type_name(): string
Instance methods(11)
- Set(aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, aDensity: number, aDensName: TCollection_HAsciiString, aDensValType: TCollection_HAsciiString): voidParameters (5)
aNameaDescriptionaDensityaDensNameaDensValType
- GetDensity(): number
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_MaterialTool
Provides tools to store and retrieve attributes (materials) of TopoDS_Shape in and from TDocStd_Document A Document is intended to hold different attributes of ONE shape and it's sub-shapes Provide tools for management of Materialss section of document.
Constructors(1)
Static methods(6)
Creates (if not exist) MaterialTool.
Parameters (1)L
- GetMaterial(MatL: TDF_Label, aDensity: number): { returnValue: boolean; aName: TCollection_HAsciiString; aDescription: TCollection_HAsciiString; aDensity: number; aDensName: TCollection_HAsciiString; aDensValType: TCollection_HAsciiString; [Symbol.dispose](): void }
Returns Material assigned to <MatL> Returns False if no such Material is assigned.
Parameters (2)MatLaDensity
ReturnsA result object with fields:
returnValue: the C++ return valueaName: owned by the returned envelope.aDescription: owned by the returned envelope.aDensity: updated value from the call.aDensName: owned by the returned envelope.aDensValType: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- GetDensityForShape(ShapeL: TDF_Label): number
Find referred material and return density from it if no material --> return 0.
Parameters (1)ShapeL
- get_type_name(): string
Instance methods(10)
returns the label under which colors are stored
Returns internal
XCAFDoc_ShapeTooltool.- IsMaterial(lab: TDF_Label): boolean
Returns True if label belongs to a material table and is a Material definition.
Parameters (1)lab
- GetMaterialLabels(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of materials currently stored in the material table.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- AddMaterial(aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, aDensity: number, aDensName: TCollection_HAsciiString, aDensValType: TCollection_HAsciiString): TDF_Label
Adds a Material definition to a table and returns its label.
Parameters (5)aNameaDescriptionaDensityaDensNameaDensValType
- SetMaterial(L: TDF_Label, MatL: TDF_Label): void
Sets a link with GUID.
Parameters (2)LMatL
- SetMaterial(L: TDF_Label, aName: TCollection_HAsciiString, aDescription: TCollection_HAsciiString, aDensity: number, aDensName: TCollection_HAsciiString, aDensValType: TCollection_HAsciiString): void
Sets a link with GUID Adds a Material as necessary.
Parameters (6)LaNameaDescriptionaDensityaDensNameaDensValType
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_Note
A base note attribute. Any note contains the name of the user created the note and the creation timestamp.
Static methods(4)
- get_type_name(): string
Checks if the given label represents a note.
Parameters (1)theLabel
- Get(theLabel: TDF_Label): XCAFDoc_Note
Finds a reference attribute on the given label and returns it, if it is found.
Parameters (1)theLabel
Instance methods(9)
- Set(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString): void
Sets the user name and the timestamp of the note.
Parameters (2)theUserName—- the user associated with the note.
theTimeStamp—- timestamp of the note.
ReturnsA handle to the attribute instance.
Returns the user name, who created the note.
Returns the timestamp of the note.
- IsOrphan(): boolean
Checks if the note isn't linked to annotated items.
Returns auxiliary data object.
- SetObject(theObject: XCAFNoteObjects_NoteObject): void
Updates auxiliary data.
Parameters (1)theObject
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_NoteBalloon
A comment note attribute. Contains a textual comment.
Constructors(1)
Creates an empty comment note.
Static methods(5)
- get_type_name(): string
Returns default attribute GUID.
- Get(theLabel: TDF_Label): XCAFDoc_NoteBalloon
Finds a reference attribute on the given label and returns it, if it is found.
Parameters (1)theLabel
- Set(theLabel: TDF_Label, theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theComment: TCollection_ExtendedString): XCAFDoc_NoteBalloon
Create (if not exist) a comment note on the given label.
Parameters (4)theLabel—- note label.
theUserName—- the name of the user, who created the note.
theTimeStamp—- creation timestamp of the note.
theComment—- comment text.
Instance methods(5)
- Set(theComment: TCollection_ExtendedString): void
Create (if not exist) a comment note on the given label.
Parameters (1)theComment—- comment text.
- Set(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString): void
Create (if not exist) a comment note on the given label.
Parameters (2)theUserName—- the name of the user, who created the note.
theTimeStamp—- creation timestamp of the note.
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_NoteBinData
Constructors(1)
Creates an empty binary data note.
Static methods(4)
Returns default attribute GUID.
- Get(theLabel: TDF_Label): XCAFDoc_NoteBinData
Finds a binary data attribute on the given label and returns it, if it is found.
Parameters (1)theLabel
- Set(theLabel: TDF_Label, theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theTitle: TCollection_ExtendedString, theMIMEtype: TCollection_AsciiString, theData: TColStd_HArray1OfByte): XCAFDoc_NoteBinDataParameters (6)
theLabeltheUserNametheTimeStamptheTitletheMIMEtypetheData
Instance methods(11)
- Set(theTitle: TCollection_ExtendedString, theMIMEtype: TCollection_AsciiString, theData: TColStd_HArray1OfByte): voidParameters (3)
theTitletheMIMEtypetheData
- Set(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString): voidParameters (2)
theUserNametheTimeStamp
Returns the note title.
Returns data MIME type.
- Size(): number
Size of data in bytes.
- Data(): TColStd_HArray1OfByte
Returns byte data array.
- ID(): Standard_GUID
Returns the ID of the attribute.
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_NoteComment
A comment note attribute. Contains a textual comment.
Constructors(1)
Creates an empty comment note.
Static methods(5)
- get_type_name(): string
Returns default attribute GUID.
- Get(theLabel: TDF_Label): XCAFDoc_NoteComment
Finds a reference attribute on the given label and returns it, if it is found.
Parameters (1)theLabel
- Set(theLabel: TDF_Label, theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theComment: TCollection_ExtendedString): XCAFDoc_NoteComment
Create (if not exist) a comment note on the given label.
Parameters (4)theLabel—- note label.
theUserName—- the name of the user, who created the note.
theTimeStamp—- creation timestamp of the note.
theComment—- comment text.
Instance methods(8)
- Set(theComment: TCollection_ExtendedString): void
Sets the comment text.
Parameters (1)theComment
- Set(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString): void
Create (if not exist) a comment note on the given label.
Parameters (2)theUserName—- the name of the user, who created the note.
theTimeStamp—- creation timestamp of the note.
Returns the comment text.
- ID(): Standard_GUID
Returns the ID of the attribute.
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_NotesTool
A tool to annotate items in the hierarchical product structure. There are two basic entities, which operates the notes tool: notes and annotated items.
A note is a user defined data structure derived from XCAFDoc_Note attribute that is attached to a separate label under the notes hive.
An annotated item is represented by XCAFDoc_AssemblyItemRef attribute attached to a separate label under the annotated items hive. Notes are linked with annotated items by means of XCAFDoc_GraphNode attribute. Notes play parent roles and annotated items - child roles.
| XCAFDoc_DocumentTool |
| 0:1 |
|1
| XCAFDoc_NotesTool |
| 0:1:9 |
|1 | ------------------ -------------------------- +| Notes |----| XCAFDoc_Note | | 1| 0:1:9:1 |1 | 0:1:9:1: | | ------------------ -------------------------- | !* | { XCAFDoc_GraphNode } | *! | ------------------ -------------------------- +| Annotated items |----| XCAFDoc_AssemblyItemRef | 1| 0:1:9:2 |1 | 0:1:9:2: |
A typical annotation procedure is illustrated by the code example below:
Constructors(1)
Creates an empty notes tool.
Static methods(3)
Returns default attribute GUID.
- Set(theLabel: TDF_Label): XCAFDoc_NotesTool
Create (if not exist) a notes tool from
XCAFDocon theLabel.Parameters (1)theLabel
Instance methods(48)
Returns the label of the notes hive.
Returns the label of the annotated items hive.
- NbNotes(): number
Returns the number of labels in the notes hive.
- NbAnnotatedItems(): number
Returns the number of labels in the annotated items hive.
- GetNotes(theNoteLabels: NCollection_Sequence_TDF_Label): void
Returns all labels from the notes hive. The label sequence isn't cleared beforehand.
Parameters (1)theNoteLabels—- sequence of labels. Mutated in place; read the updated value from this argument after the call.
- GetNotes(theItemId: XCAFDoc_AssemblyItemId, theNoteLabels: NCollection_Sequence_TDF_Label): number
Returns all labels from the notes hive. The label sequence isn't cleared beforehand.
Parameters (2)theItemIdtheNoteLabels—- sequence of labels. Mutated in place; read the updated value from this argument after the call.
- GetNotes(theItemLabel: TDF_Label, theNoteLabels: NCollection_Sequence_TDF_Label): number
Returns all labels from the notes hive. The label sequence isn't cleared beforehand.
Parameters (2)theItemLabeltheNoteLabels—- sequence of labels. Mutated in place; read the updated value from this argument after the call.
- GetAnnotatedItems(theLabels: NCollection_Sequence_TDF_Label): void
Returns all labels from the annotated items hive. The label sequence isn't cleared beforehand.
Parameters (1)theLabels—Mutated in place; read the updated value from this argument after the call.
- IsAnnotatedItem(theItemId: XCAFDoc_AssemblyItemId): boolean
Checks if the given assembly item is annotated.
Parameters (1)theItemId—- assembly item ID.
Returnstrue if the item is annotated, otherwise - false.
- IsAnnotatedItem(theItemLabel: TDF_Label): boolean
Checks if the given labeled item is annotated.
Parameters (1)theItemLabel—- item label.
Returnstrue if the item is annotated, otherwise - false.
- FindAnnotatedItem(theItemId: XCAFDoc_AssemblyItemId): TDF_LabelParameters (1)
theItemId
- FindAnnotatedItem(theItemLabel: TDF_Label): TDF_LabelParameters (1)
theItemLabel
- FindAnnotatedItemAttr(theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID): TDF_LabelParameters (2)
theItemIdtheGUID
- FindAnnotatedItemAttr(theItemLabel: TDF_Label, theGUID: Standard_GUID): TDF_LabelParameters (2)
theItemLabeltheGUID
- FindAnnotatedItemSubshape(theItemId: XCAFDoc_AssemblyItemId, theSubshapeIndex: number): TDF_LabelParameters (2)
theItemIdtheSubshapeIndex
- FindAnnotatedItemSubshape(theItemLabel: TDF_Label, theSubshapeIndex: number): TDF_LabelParameters (2)
theItemLabeltheSubshapeIndex
- CreateComment(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theComment: TCollection_ExtendedString): XCAFDoc_NoteParameters (3)
theUserNametheTimeStamptheComment
- CreateBalloon(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theComment: TCollection_ExtendedString): XCAFDoc_NoteParameters (3)
theUserNametheTimeStamptheComment
- CreateBinData(theUserName: TCollection_ExtendedString, theTimeStamp: TCollection_ExtendedString, theTitle: TCollection_ExtendedString, theMIMEtype: TCollection_AsciiString, theData: TColStd_HArray1OfByte): XCAFDoc_NoteParameters (5)
theUserNametheTimeStamptheTitletheMIMEtypetheData
- GetAttrNotes(theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID, theNoteLabels: NCollection_Sequence_TDF_Label): numberParameters (3)
theItemIdtheGUIDtheNoteLabels
- GetAttrNotes(theItemLabel: TDF_Label, theGUID: Standard_GUID, theNoteLabels: NCollection_Sequence_TDF_Label): numberParameters (3)
theItemLabeltheGUIDtheNoteLabels
- GetSubshapeNotes(theItemId: XCAFDoc_AssemblyItemId, theSubshapeIndex: number, theNoteLabels: NCollection_Sequence_TDF_Label): numberParameters (3)
theItemIdtheSubshapeIndextheNoteLabels
- AddNote(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId): XCAFDoc_AssemblyItemRefParameters (2)
theNoteLabeltheItemId
- AddNote(theNoteLabel: TDF_Label, theItemLabel: TDF_Label): XCAFDoc_AssemblyItemRefParameters (2)
theNoteLabeltheItemLabel
- AddNoteToAttr(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID): XCAFDoc_AssemblyItemRefParameters (3)
theNoteLabeltheItemIdtheGUID
- AddNoteToAttr(theNoteLabel: TDF_Label, theItemLabel: TDF_Label, theGUID: Standard_GUID): XCAFDoc_AssemblyItemRefParameters (3)
theNoteLabeltheItemLabeltheGUID
- AddNoteToSubshape(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theSubshapeIndex: number): XCAFDoc_AssemblyItemRefParameters (3)
theNoteLabeltheItemIdtheSubshapeIndex
- AddNoteToSubshape(theNoteLabel: TDF_Label, theItemLabel: TDF_Label, theSubshapeIndex: number): XCAFDoc_AssemblyItemRefParameters (3)
theNoteLabeltheItemLabeltheSubshapeIndex
- RemoveNote(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theDelIfOrphan: boolean): booleanParameters (3)
theNoteLabeltheItemIdtheDelIfOrphan
- RemoveNote(theNoteLabel: TDF_Label, theItemLabel: TDF_Label, theDelIfOrphan: boolean): booleanParameters (3)
theNoteLabeltheItemLabeltheDelIfOrphan
- RemoveSubshapeNote(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theSubshapeIndex: number, theDelIfOrphan: boolean): booleanParameters (4)
theNoteLabeltheItemIdtheSubshapeIndextheDelIfOrphan
- RemoveSubshapeNote(theNoteLabel: TDF_Label, theItemLabel: TDF_Label, theSubshapeIndex: number, theDelIfOrphan: boolean): booleanParameters (4)
theNoteLabeltheItemLabeltheSubshapeIndextheDelIfOrphan
- RemoveAttrNote(theNoteLabel: TDF_Label, theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID, theDelIfOrphan: boolean): booleanParameters (4)
theNoteLabeltheItemIdtheGUIDtheDelIfOrphan
- RemoveAttrNote(theNoteLabel: TDF_Label, theItemLabel: TDF_Label, theGUID: Standard_GUID, theDelIfOrphan: boolean): booleanParameters (4)
theNoteLabeltheItemLabeltheGUIDtheDelIfOrphan
- RemoveAllNotes(theItemId: XCAFDoc_AssemblyItemId, theDelIfOrphan: boolean): booleanParameters (2)
theItemIdtheDelIfOrphan
- RemoveAllNotes(theItemLabel: TDF_Label, theDelIfOrphan: boolean): booleanParameters (2)
theItemLabeltheDelIfOrphan
- RemoveAllSubshapeNotes(theItemId: XCAFDoc_AssemblyItemId, theSubshapeIndex: number, theDelIfOrphan?: boolean): booleanParameters (3)
theItemIdtheSubshapeIndextheDelIfOrphan
- RemoveAllAttrNotes(theItemId: XCAFDoc_AssemblyItemId, theGUID: Standard_GUID, theDelIfOrphan: boolean): booleanParameters (3)
theItemIdtheGUIDtheDelIfOrphan
- RemoveAllAttrNotes(theItemLabel: TDF_Label, theGUID: Standard_GUID, theDelIfOrphan: boolean): booleanParameters (3)
theItemLabeltheGUIDtheDelIfOrphan
- DeleteNote(theNoteLabel: TDF_Label): booleanParameters (1)
theNoteLabel
- DeleteNotes(theNoteLabels: NCollection_Sequence_TDF_Label): numberParameters (1)
theNoteLabels
- DeleteAllNotes(): number
- NbOrphanNotes(): number
- GetOrphanNotes(theNoteLabels: NCollection_Sequence_TDF_Label): voidParameters (1)
theNoteLabels
- DeleteOrphanNotes(): number
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_ShapeMapTool
attribute containing map of sub shapes
Constructors(1)
Creates an empty tool.
Static methods(4)
Create (if not exist) ShapeTool from
XCAFDocon <L>.Parameters (1)L
- get_type_name(): string
Instance methods(8)
- IsSubShape(sub: TopoDS_Shape): boolean
Checks whether shape is subshape of shape stored on label shapeL.
Parameters (1)sub
- SetShape(S: TopoDS_Shape): void
Sets representation (
TopoDS_Shape) for top-level shape.Parameters (1)S
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
XCAFDoc_ShapeTool
A tool to store shapes in an XDE document in the form of assembly structure, and to maintain this structure. Attribute containing Shapes section of DECAF document. Provide tools for management of Shapes section. The API provided by this class allows to work with this structure regardless of its low-level implementation. All the shapes are stored on child labels of a main label which is XCAFDoc_DocumentTool::LabelShapes().
The label for assembly also has sub-labels, each of which represents the instance of another shape in that assembly (component).
Such sub-label stores reference to the label of the original shape in the form of TDataStd_TreeNode with GUID XCAFDoc::ShapeRefGUID(), and its location encapsulated into the NamedShape. For correct work with an XDE document, it is necessary to use methods for analysis and methods for working with shapes.
For example: if ( STool->IsAssembly(aLabel) ) { bool subchilds = false; (default) int nbc = STool->NbComponents (aLabel[,subchilds]); } If subchilds is True, commands also consider sub-levels. By default, only level one is checked. In this example, number of children from the first level of assembly will be returned.
Methods for creation and initialization: Constructor: XCAFDoc_ShapeTool::XCAFDoc_ShapeTool() Getting a guid: Standard_GUID GetID (); Creation (if does not exist) of ShapeTool on label L: occ::handle<XCAFDoc_ShapeTool> XCAFDoc_ShapeTool::Set(const TDF_Label& L) Analyze whether shape is a simple shape or an instance or a component of an assembly or it is an assembly ( methods of analysis).
For example: STool->IsShape(aLabel) ; Analyze that the label represents a shape (simple shape, assembly or reference) or STool->IsTopLevel(aLabel); Analyze that the label is a label of a top-level shape. Work with simple shapes, assemblies and instances ( methods for work with shapes).
For example: Add shape: bool makeAssembly; // True to interpret a Compound as an Assembly, False to take it as a whole aLabel = STool->AddShape(aShape, makeAssembly); Get shape: TDF_Label aLabel... // A label must be present if (aLabel.IsNull()) { ... no such label : abandon .. } TopoDS_Shape aShape; aShape = STool->GetShape(aLabel); if (aShape.IsNull()) { ... this label is not for a Shape ... } To get a label from shape. bool findInstance = false; (this is default value) aLabel = STool->FindShape(aShape [,findInstance]); if (aLabel.IsNull()) { ... no label found for this shape ... }.
Constructors(1)
Creates an empty tool Creates a tool to work with a document <Doc> Attaches to label XCAFDoc::LabelShapes().
Static methods(30)
Create (if not exist) ShapeTool from
XCAFDocon <L>.Parameters (1)L
Returns True if the label is not used by any assembly, i.e. contains sublabels which are assembly components This is relevant only if
IsShape()is True (There is no Father TreeNode on this <L>).Parameters (1)L
Returns True if the label represents a shape (simple shape, assembly or reference).
Parameters (1)L
- IsSimpleShape(L: TDF_Label): boolean
Returns True if the label is a label of simple shape.
Parameters (1)L
- IsReference(L: TDF_Label): boolean
Return true if <L> is a located instance of other shape i.e. reference.
Parameters (1)L
- IsAssembly(L: TDF_Label): boolean
Returns True if the label is a label of assembly, i.e. contains sublabels which are assembly components This is relevant only if
IsShape()is True.Parameters (1)L
- IsComponent(L: TDF_Label): boolean
Return true if <L> is reference serving as component of assembly.
Parameters (1)L
- IsCompound(L: TDF_Label): boolean
Returns True if the label is a label of compound, i.e. contains some sublabels This is relevant only if
IsShape()is True.Parameters (1)L
- IsSubShape(L: TDF_Label): boolean
Return true if <L> is subshape of the top-level shape.
Parameters (1)L
- GetShape(L: TDF_Label, S: TopoDS_Shape): boolean
To get
TopoDS_Shapefrom shape's label For component, returns new shape with correct location Returns False if label does not contain shape.Parameters (2)LS—Mutated in place; read the updated value from this argument after the call.
To get
TopoDS_Shapefrom shape's label For component, returns new shape with correct location Returns Null shape if label does not contain shape.Parameters (1)L
- GetOneShape(theLabels: NCollection_Sequence_TDF_Label): TopoDS_Shape
Gets shape from a sequence of shape's labels.
Parameters (1)theLabels—a sequence of labels to get shapes from
Returnsoriginal shape in case of one label and a compound of shapes in case of more
- SetAutoNaming(V: boolean): void
Sets auto-naming mode to <V>. If True then for added shapes, links, assemblies and SHUO's, the
TDataStd_Nameattribute is automatically added. For shapes it contains a shape type (e.g. "SOLID", "SHELL", etc); for links it has a form "=>[0:1:1:2]" (where a tag is a label containing a shape without a location); for assemblies it is "ASSEMBLY", and "SHUO" for SHUO's. This setting is global; it cannot be made a member function as it is used by static methods as well. By default, auto-naming is enabled. See alsoAutoNaming().Parameters (1)V
- AutoNaming(): boolean
Returns current auto-naming mode. See
SetAutoNaming()for description. - GetUsers(L: TDF_Label, Labels: NCollection_Sequence_TDF_Label, getsubchilds: boolean): number
Returns list of labels which refer shape L as component Returns number of users (0 if shape is free).
Parameters (3)LLabels—Mutated in place; read the updated value from this argument after the call.getsubchilds
Returns location of instance.
Parameters (1)L
- GetReferredShape(L: TDF_Label, Label: TDF_Label): boolean
Returns label which corresponds to a shape referred by L Returns False if label is not reference.
Parameters (2)LLabel—Mutated in place; read the updated value from this argument after the call.
- NbComponents(L: TDF_Label, getsubchilds?: boolean): number
Returns number of Assembles components.
Parameters (2)Lgetsubchilds
- GetComponents(L: TDF_Label, Labels: NCollection_Sequence_TDF_Label, getsubchilds: boolean): boolean
Returns list of components of assembly Returns False if label is not assembly.
Parameters (3)LLabels—Mutated in place; read the updated value from this argument after the call.getsubchilds
- GetSubShapes(L: TDF_Label, Labels: NCollection_Sequence_TDF_Label): boolean
Returns list of labels identifying subshapes of the given shape Returns False if no subshapes are placed on that label.
Parameters (2)LLabels—Mutated in place; read the updated value from this argument after the call.
- IsExternRef(L: TDF_Label): boolean
Returns True if the label is a label of external references, i.e. there are some reference on the no-step files, which are described in document only their names.
Parameters (1)L
- GetExternRefs(L: TDF_Label, SHAS: NCollection_Sequence_handle_TCollection_HAsciiString): void
Gets the names of references on the no-step files.
Parameters (2)LSHAS—Mutated in place; read the updated value from this argument after the call.
- GetSHUO(SHUOLabel: TDF_Label): { returnValue: boolean; aSHUOAttr: XCAFDoc_GraphNode; [Symbol.dispose](): void }
Returns founded SHUO GraphNode attribute <aSHUOAttr> Returns false in other case.
Parameters (1)SHUOLabel
ReturnsA result object with fields:
returnValue: the C++ return valueaSHUOAttr: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- GetAllComponentSHUO(CompLabel: TDF_Label, SHUOAttrs: NCollection_Sequence_handle_TDF_Attribute): boolean
Returns founded SHUO GraphNodes of indicated component Returns false in other case.
Parameters (2)CompLabelSHUOAttrs—Mutated in place; read the updated value from this argument after the call.
- GetSHUOUpperUsage(NextUsageL: TDF_Label, Labels: NCollection_Sequence_TDF_Label): boolean
Returns the sequence of labels of SHUO attributes, which is upper_usage for this next_usage SHUO attribute (that indicated by label) NOTE: returns upper_usages only on one level (not recurse) NOTE: do not clear the sequence before filling.
Parameters (2)NextUsageLLabels—Mutated in place; read the updated value from this argument after the call.
- GetSHUONextUsage(UpperUsageL: TDF_Label, Labels: NCollection_Sequence_TDF_Label): boolean
Returns the sequence of labels of SHUO attributes, which is next_usage for this upper_usage SHUO attribute (that indicated by label) NOTE: returns next_usages only on one level (not recurse) NOTE: do not clear the sequence before filling.
Parameters (2)UpperUsageLLabels—Mutated in place; read the updated value from this argument after the call.
- FindSHUO(Labels: NCollection_Sequence_TDF_Label): { returnValue: boolean; theSHUOAttr: XCAFDoc_GraphNode; [Symbol.dispose](): void }
Searches the SHUO by labels of components from upper_usage component to next_usage Returns null attribute if no SHUO found.
Parameters (1)Labels
ReturnsA result object with fields:
returnValue: the C++ return valuetheSHUOAttr: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- get_type_name(): string
Instance methods(41)
- IsTopLevel(L: TDF_Label): boolean
Returns True if the label is a label of top-level shape, as opposed to component of assembly or subshape.
Parameters (1)L
- IsSubShape(shapeL: TDF_Label, sub: TopoDS_Shape): boolean
Checks whether shape is subshape of shape stored on label shapeL.
Parameters (2)shapeLsub
- SearchUsingMap(S: TopoDS_Shape, L: TDF_Label, findWithoutLoc: boolean, findSubshape: boolean): booleanParameters (4)
SLfindWithoutLocfindSubshape
- Search(S: TopoDS_Shape, L: TDF_Label, findInstance: boolean, findComponent: boolean, findSubshape: boolean): boolean
General tool to find a (sub) shape in the document.
- If findInstance is True, and S has a non-null location, first tries to find the shape among the top-level shapes with this location
- If not found, and findComponent is True, tries to find the shape among the components of assemblies
- If not found, tries to find the shape without location among top-level shapes
- If not found and findSubshape is True, tries to find a shape as a subshape of top-level simple shapes Returns False if nothing is found
Parameters (5)SL—Mutated in place; read the updated value from this argument after the call.findInstancefindComponentfindSubshape
- FindShape(S: TopoDS_Shape, L: TDF_Label, findInstance: boolean): boolean
Returns the label corresponding to shape S (searches among top-level shapes, not including subcomponents of assemblies and subshapes) If findInstance is False (default), search for the input shape without location If findInstance is True, searches for the input shape as is. Return True if is found.
Parameters (3)SL—Mutated in place; read the updated value from this argument after the call.findInstance
- FindShape(S: TopoDS_Shape, findInstance: boolean): TDF_Label
Does the same as previous method Returns Null label if not found.
Parameters (2)SfindInstance
Gets shape from a sequence of all top-level shapes which are free.
Returnsoriginal shape in case of one label and a compound of shapes in case of more
Creates new (empty) top-level shape. Initially it holds empty
TopoDS_Compound.- SetShape(L: TDF_Label, S: TopoDS_Shape): void
Sets representation (
TopoDS_Shape) for top-level shape.Parameters (2)LS
- AddShape(S: TopoDS_Shape, makeAssembly?: boolean, makePrepare?: boolean): TDF_Label
Adds a new top-level (creates and returns a new label) If makeAssembly is True, treats TopAbs_COMPOUND shapes as assemblies (creates assembly structure). NOTE: <makePrepare> replace components without location in assembly by located components to avoid some problems. If
AutoNaming()is True then automatically attaches names.Parameters (3)SmakeAssemblymakePrepare
- RemoveShape(L: TDF_Label, removeCompletely?: boolean): boolean
Removes shape (whole label and all its sublabels) If removeCompletely is true, removes complete shape If removeCompletely is false, removes instance(location) only Returns False (and does nothing) if shape is not free or is not top-level shape.
Parameters (2)LremoveCompletely
- Init(): void
set hasComponents into false
- ComputeShapes(L: TDF_Label): void
recursive
Parameters (1)L
- ComputeSimpleShapes(): void
Compute a sequence of simple shapes.
- GetShapes(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of all top-level shapes.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- GetFreeShapes(FreeLabels: NCollection_Sequence_TDF_Label): void
Returns a sequence of all top-level shapes which are free (i.e. not referred by any other).
Parameters (1)FreeLabels—Mutated in place; read the updated value from this argument after the call.
- AddComponent(assembly: TDF_Label, comp: TDF_Label, Loc: TopLoc_Location): TDF_Label
Adds a component given by its label and location to the assembly Note: assembly must be
IsAssembly()orIsSimpleShape().Parameters (3)assemblycompLoc
- AddComponent(assembly: TDF_Label, comp: TopoDS_Shape, expand: boolean): TDF_Label
Adds a shape (located) as a component to the assembly If necessary, creates an additional top-level shape for component and return the Label of component. If expand is True and component is Compound, it will be created as assembly also Note: assembly must be
IsAssembly()orIsSimpleShape().Parameters (3)assemblycompexpand
- RemoveComponent(comp: TDF_Label): void
Removes a component from its assembly.
Parameters (1)comp
- UpdateAssemblies(): void
Top-down update for all assembly compounds stored in the document.
- FindSubShape(shapeL: TDF_Label, sub: TopoDS_Shape, L: TDF_Label): boolean
Finds a label for subshape of shape stored on label shapeL Returns Null label if it is not found.
Parameters (3)shapeLsubL—Mutated in place; read the updated value from this argument after the call.
- AddSubShape(shapeL: TDF_Label, sub: TopoDS_Shape): TDF_Label
Adds a label for subshape of shape stored on label shapeL Returns Null label if it is not subshape.
Parameters (2)shapeLsub
- AddSubShape(shapeL: TDF_Label, sub: TopoDS_Shape, addedSubShapeL: TDF_Label): boolean
Adds (of finds already existed) a label for subshape of shape stored on label shapeL. Label addedSubShapeL returns added (found) label or empty in case of wrong subshape. Returns True, if new shape was added, False in case of already existed subshape/wrong subshape.
Parameters (3)shapeLsubaddedSubShapeL—Mutated in place; read the updated value from this argument after the call.
- Parameters (1)
sub
- FindMainShape(sub: TopoDS_Shape): TDF_Label
Performs a search among top-level shapes to find the shape containing as subshape Checks only simple shapes, and returns the first found label (which should be the only one for valid model).
Parameters (1)sub
returns the label under which shapes are stored
- ID(): Standard_GUID
Returns the ID of the attribute.
Sets the names of references on the no-step files.
Parameters (1)SHAS
- SetExternRefs(L: TDF_Label, SHAS: NCollection_Sequence_handle_TCollection_HAsciiString): void
Sets the names of references on the no-step files.
Parameters (2)LSHAS
- SetSHUO(Labels: NCollection_Sequence_TDF_Label): { returnValue: boolean; MainSHUOAttr: XCAFDoc_GraphNode; [Symbol.dispose](): void }
Sets the SHUO structure between upper_usage and next_usage create multy-level (if number of labels > 2) SHUO from first to last Initialise out <MainSHUOAttr> by main upper_usage SHUO attribute. Returns FALSE if some of labels in not component label.
Parameters (1)Labels
ReturnsA result object with fields:
returnValue: the C++ return valueMainSHUOAttr: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- RemoveSHUO(SHUOLabel: TDF_Label): boolean
Remove SHUO from component sublabel, remove all dependencies on other SHUO. Returns FALSE if cannot remove SHUO dependencies. NOTE: remove any styles that associated with this SHUO.
Parameters (1)SHUOLabel
- FindComponent(theShape: TopoDS_Shape, Labels: NCollection_Sequence_TDF_Label): boolean
Search the path of labels in the document, that corresponds the component from any assembly Try to search the sequence of labels with location that produce this shape as component of any assembly NOTE: Clear sequence of labels before filling.
Parameters (2)theShapeLabels—Mutated in place; read the updated value from this argument after the call.
- GetSHUOInstance(theSHUO: XCAFDoc_GraphNode): TopoDS_Shape
Search for the component shape that styled by shuo Returns null shape if no any shape is found.
Parameters (1)theSHUO
- SetInstanceSHUO(theShape: TopoDS_Shape): XCAFDoc_GraphNode
Search for the component shape by labelks path and set SHUO structure for founded label structure Returns null attribute if no component in any assembly found.
Parameters (1)theShape
- GetAllSHUOInstances(theSHUO: XCAFDoc_GraphNode, theSHUOShapeSeq: NCollection_Sequence_TopoDS_Shape): boolean
Searching for component shapes that styled by shuo Returns empty sequence of shape if no any shape is found.
Parameters (2)theSHUOtheSHUOShapeSeq—Mutated in place; read the updated value from this argument after the call.
- SetLocation(theShapeLabel: TDF_Label, theLoc: TopLoc_Location, theRefLabel: TDF_Label): boolean
Sets location to the shape label If label is reference -> changes location attribute If label is free shape -> creates reference with location to it.
Parameters (3)theShapeLabel—the shape label to change locationtheLoc—location to settheRefLabel—the reference label with new location Mutated in place; read the updated value from this argument after the call.
ReturnsTRUE if new location was set
Convert Shape (compound/compsolid/shell/wire) to assembly.
Parameters (1)Shape
- GetNamedProperties(theLabel: TDF_Label, theToCreate: boolean): TDataStd_NamedData
Method to get NamedData attribute assigned to the given shape label.
Parameters (2)theLabel—the shape LabeltheToCreate—create and assign attribute if it doesn't exist
ReturnsHandle to the NamedData attribute or Null if there is none
- GetNamedProperties(theShape: TopoDS_Shape, theToCreate: boolean): TDataStd_NamedData
Method to get NamedData attribute assigned to a label of the given shape.
Parameters (2)theShape—input shapetheToCreate—create and assign attribute if it doesn't exist
ReturnsHandle to the NamedData attribute or Null if there is none
XCAFDoc_View
Attribute to store view.
Constructors(1)
Static methods(4)
- Set(theLabel: TDF_Label): XCAFDoc_ViewParameters (1)
theLabel
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Returns the ID of the attribute.
- SetObject(theViewObject: XCAFView_Object): void
Updates parent's label and its sub-labels with data taken from theViewObject. Old data associated with the label will be lost.
Parameters (1)theViewObject
Returns view object data taken from the paren's label and its sub-labels.
XCAFDoc_ViewTool
Provides tools to store and retrieve Views in and from TDocStd_Document Each View contains parts XCAFDoc_View attribute with all information about camera and view window. Also each view contain information of displayed shapes and GDTs as sets of shape and GDT labels.
Constructors(1)
Static methods(4)
- Set(L: TDF_Label): XCAFDoc_ViewTool
Creates (if not exist) ViewTool.
Parameters (1)L
- get_type_name(): string
Instance methods(25)
Returns the label under which Views are stored.
Returns True if label belongs to a View table and is a View definition.
Parameters (1)theLabel
- GetViewLabels(theLabels: NCollection_Sequence_TDF_Label): void
Returns a sequence of View labels currently stored in the View table.
Parameters (1)theLabels—Mutated in place; read the updated value from this argument after the call.
- SetView(theShapes: NCollection_Sequence_TDF_Label, theGDTs: NCollection_Sequence_TDF_Label, theClippingPlanes: NCollection_Sequence_TDF_Label, theNotes: NCollection_Sequence_TDF_Label, theAnnotations: NCollection_Sequence_TDF_Label, theViewL: TDF_Label): void
Sets a link with GUID.
Parameters (6)theShapestheGDTstheClippingPlanestheNotestheAnnotationstheViewL
- SetView(theShapes: NCollection_Sequence_TDF_Label, theGDTs: NCollection_Sequence_TDF_Label, theClippingPlanes: NCollection_Sequence_TDF_Label, theViewL: TDF_Label): void
Sets a link with GUID.
Parameters (4)theShapestheGDTstheClippingPlanestheViewL
- SetView(theShapes: NCollection_Sequence_TDF_Label, theGDTs: NCollection_Sequence_TDF_Label, theViewL: TDF_Label): void
Sets a link with GUID.
Parameters (3)theShapestheGDTstheViewL
- SetClippingPlanes(theClippingPlaneLabels: NCollection_Sequence_TDF_Label, theViewL: TDF_Label): void
Set Clipping planes to given View.
Parameters (2)theClippingPlaneLabelstheViewL
- RemoveView(theViewL: TDF_Label): void
Remove View.
Parameters (1)theViewL
- GetViewLabelsForShape(theShapeL: TDF_Label, theViews: NCollection_Sequence_TDF_Label): boolean
Returns all View labels defined for label ShapeL.
Parameters (2)theShapeLtheViews—Mutated in place; read the updated value from this argument after the call.
- GetViewLabelsForGDT(theGDTL: TDF_Label, theViews: NCollection_Sequence_TDF_Label): boolean
Returns all View labels defined for label GDTL.
Parameters (2)theGDTLtheViews—Mutated in place; read the updated value from this argument after the call.
- GetViewLabelsForClippingPlane(theClippingPlaneL: TDF_Label, theViews: NCollection_Sequence_TDF_Label): boolean
Returns all View labels defined for label ClippingPlaneL.
Parameters (2)theClippingPlaneLtheViews—Mutated in place; read the updated value from this argument after the call.
- GetViewLabelsForNote(theNoteL: TDF_Label, theViews: NCollection_Sequence_TDF_Label): boolean
Returns all View labels defined for label NoteL.
Parameters (2)theNoteLtheViews—Mutated in place; read the updated value from this argument after the call.
- GetViewLabelsForAnnotation(theAnnotationL: TDF_Label, theViews: NCollection_Sequence_TDF_Label): boolean
Returns all View labels defined for label AnnotationL.
Parameters (2)theAnnotationLtheViews—Mutated in place; read the updated value from this argument after the call.
Adds a view definition to a View table and returns its label.
- GetRefShapeLabel(theViewL: TDF_Label, theShapeLabels: NCollection_Sequence_TDF_Label): boolean
Returns shape labels defined for label theViewL Returns False if the theViewL is not in View table.
Parameters (2)theViewLtheShapeLabels—Mutated in place; read the updated value from this argument after the call.
- GetRefGDTLabel(theViewL: TDF_Label, theGDTLabels: NCollection_Sequence_TDF_Label): boolean
Returns GDT labels defined for label theViewL Returns False if the theViewL is not in View table.
Parameters (2)theViewLtheGDTLabels—Mutated in place; read the updated value from this argument after the call.
- GetRefClippingPlaneLabel(theViewL: TDF_Label, theClippingPlaneLabels: NCollection_Sequence_TDF_Label): boolean
Returns ClippingPlane labels defined for label theViewL Returns False if the theViewL is not in View table.
Parameters (2)theViewLtheClippingPlaneLabels—Mutated in place; read the updated value from this argument after the call.
- GetRefNoteLabel(theViewL: TDF_Label, theNoteLabels: NCollection_Sequence_TDF_Label): boolean
Returns Notes labels defined for label theViewL Returns False if the theViewL is not in View table.
Parameters (2)theViewLtheNoteLabels—Mutated in place; read the updated value from this argument after the call.
- GetRefAnnotationLabel(theViewL: TDF_Label, theAnnotationLabels: NCollection_Sequence_TDF_Label): boolean
Returns Annotation labels defined for label theViewL Returns False if the theViewL is not in View table.
Parameters (2)theViewLtheAnnotationLabels—Mutated in place; read the updated value from this argument after the call.
Returns true if the given View is marked as locked.
Parameters (1)theViewL
Mark the given View as locked.
Parameters (1)theViewL
Unlock the given View.
Parameters (1)theViewL
- ID(): Standard_GUID
Returns the ID of the attribute.
XCAFDoc_VisMaterial
Attribute storing Material definition for visualization purposes.
Visualization material provides extended information about how object should be displayed on the screen (albedo, metalness, roughness - not just a single color as in case of XCAFDoc_Color). It is expected to correlate with physical material properties (XCAFDoc_Material), but not necessarily (like painted/polished/rusty object).
The document defines the list of visualization materials via global attribute XCAFDoc_VisMaterialTool, while particular material assignment to the shape is done through tree-nodes links. Therefore, XCAFDoc_VisMaterialTool methods should be used for managing XCAFDoc_VisMaterial attributes.
Visualization material definition consists of two options: Common and PBR (for Physically Based Rendering). Common material definition is an obsolete model defined by very first version of OpenGL graphics API and having specific hardware-accelerated implementation in past (like T&L). PBR metallic-roughness model is closer to physical material properties, and intended to be used within physically-based renderer.
For compatibility reasons, this attribute allows defining both material models, so that it is up-to Data Exchange and Application deciding which one to define and use for rendering (depending on viewer capabilities). Automatic conversion from one model to another is possible, but lossy (converted material will not look the same).
Within Data Exchange, different file formats have different capabilities for storing visualization material properties from simple color (STEP, IGES), to common (OBJ, glTF 1.0) and PBR (glTF 2.0). This should be taken into account while defining or converting document into one or another format - material definition might be lost or disturbed.
Constructors(1)
Empty constructor.
Static methods(2)
Return attribute GUID.
Instance methods(28)
- IsEmpty(): boolean
Return TRUE if material definition is empty.
- FillAspect(theAspect: unknown): void
Fill in graphic aspects.
Parameters (1)theAspect
- HasPbrMaterial(): boolean
Return TRUE if metal-roughness PBR material is defined; FALSE by default.
Return metal-roughness PBR material. Note that default constructor creates an empty material (.
See alsoXCAFDoc_VisMaterialPBR::IsDefined
- SetPbrMaterial(theMaterial: XCAFDoc_VisMaterialPBR): void
Setup metal-roughness PBR material.
Parameters (1)theMaterial
- UnsetPbrMaterial(): void
Setup undefined metal-roughness PBR material.
- HasCommonMaterial(): boolean
Return TRUE if common material is defined; FALSE by default.
Return common material. Note that default constructor creates an empty material (.
See alsoXCAFDoc_VisMaterialCommon::IsDefined
- SetCommonMaterial(theMaterial: XCAFDoc_VisMaterialCommon): void
Setup common material.
Parameters (1)theMaterial
- UnsetCommonMaterial(): void
Setup undefined common material.
Return base color.
- AlphaMode(): Graphic3d_AlphaMode
Return alpha mode; Graphic3d_AlphaMode_BlendAuto by default.
- AlphaCutOff(): number
Return alpha cutoff value; 0.5 by default.
- SetAlphaMode(theMode: Graphic3d_AlphaMode, theCutOff?: number): void
Set alpha mode.
Parameters (2)theModetheCutOff
- FaceCulling(): Graphic3d_TypeOfBackfacingModel
Returns if the material is double or single sided; Graphic3d_TypeOfBackfacingModel_Auto by default.
- SetFaceCulling(theFaceCulling: Graphic3d_TypeOfBackfacingModel): void
Specifies whether the material is double or single sided.
Parameters (1)theFaceCulling
- IsDoubleSided(): booleanDeprecated
- SetDoubleSided(theIsDoubleSided: boolean): voidDeprecatedParameters (1)
theIsDoubleSided
Return material name / tag (transient data, not stored in the document).
- SetRawName(theName: TCollection_HAsciiString): void
Set material name / tag (transient data, not stored in the document).
Parameters (1)theName
- IsEqual(theOther: XCAFDoc_VisMaterial): boolean
Compare two materials. Performs deep comparison by actual values - e.g. can be useful for merging materials.
Parameters (1)theOther
Return Common material or convert PBR into Common material.
Return PBR material or convert Common into PBR material.
- ID(): Standard_GUID
- Restore(anAttribute: TDF_Attribute): voidParameters (1)
anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): voidParameters (2)
intoAttributeaRelocationTable
XCAFDoc_VisMaterialCommon
Common (obsolete) material definition.
Constructors(1)
Empty constructor.
Instance methods(1)
- IsEqual(theOther: XCAFDoc_VisMaterialCommon): boolean
Compare two materials.
Parameters (1)theOther
Properties(8)
XCAFDoc_VisMaterialPBR
Metallic-roughness PBR material definition.
Constructors(1)
Empty constructor.
Instance methods(1)
- IsEqual(theOther: XCAFDoc_VisMaterialPBR): boolean
Compare two materials.
Parameters (1)theOther
Properties(11)
XCAFDoc_VisMaterialTool
Provides tools to store and retrieve attributes (visualization materials) of TopoDS_Shape in and from TDocStd_Document.
This attribute defines the list of visualization materials (XCAFDoc_VisMaterial) within the whole document. Particular material is assigned to the shape through tree-nodes links.
Visualization materials might co-exists with independent color attributes (XCAFDoc_ColorTool), but beware to preserve consistency between them (it is better using one attribute type at once to avoid ambiguity). Unlike color attributes, list of materials should be managed explicitly by application, so that there is no tool eliminating material duplicates or removing unused materials.
Constructors(1)
Empty constructor.
Static methods(7)
- get_type_name(): string
Creates (if not exist) ColorTool.
Parameters (1)L
- GetMaterial(theMatLabel: TDF_Label): XCAFDoc_VisMaterial
Returns Material defined by specified Label, or NULL if the label is not in Material Table.
Parameters (1)theMatLabel
- GetShapeMaterial(theShapeLabel: TDF_Label): XCAFDoc_VisMaterial
Returns material assigned to the shape label.
Parameters (1)theShapeLabel
- GetShapeMaterial(theShapeLabel: TDF_Label, theMaterialLabel: TDF_Label): boolean
Returns label with material assigned to shape label.
Parameters (2)theShapeLabel—shape labeltheMaterialLabel—material label Mutated in place; read the updated value from this argument after the call.
ReturnsFALSE if no material is assigned
Instance methods(20)
returns the label under which colors are stored
Returns internal
XCAFDoc_ShapeTooltool.- IsMaterial(theLabel: TDF_Label): boolean
Returns TRUE if Label belongs to a Material Table.
Parameters (1)theLabel
- AddMaterial(theMat: XCAFDoc_VisMaterial, theName: TCollection_AsciiString): TDF_Label
Adds Material definition to a Material Table and returns its Label.
Parameters (2)theMattheName
- AddMaterial(theName: TCollection_AsciiString): TDF_Label
Adds Material definition to a Material Table and returns its Label.
Parameters (1)theName
- RemoveMaterial(theLabel: TDF_Label): void
Removes Material from the Material Table.
Parameters (1)theLabel
- GetMaterials(Labels: NCollection_Sequence_TDF_Label): void
Returns a sequence of Materials currently stored in the Material Table.
Parameters (1)Labels—Mutated in place; read the updated value from this argument after the call.
- SetShapeMaterial(theShapeLabel: TDF_Label, theMaterialLabel: TDF_Label): void
Sets a link with GUID
XCAFDoc::VisMaterialRefGUID()from shape label to material label.Parameters (2)theShapeLabeltheMaterialLabel—material label
ReturnsFALSE if cannot find a label for shape
- SetShapeMaterial(theShape: TopoDS_Shape, theMaterialLabel: TDF_Label): boolean
Sets a link with GUID
XCAFDoc::VisMaterialRefGUID()from shape label to material label.Parameters (2)theShape—shapetheMaterialLabel—material label
ReturnsFALSE if cannot find a label for shape
- UnSetShapeMaterial(theShapeLabel: TDF_Label): void
Removes a link with GUID
XCAFDoc::VisMaterialRefGUID()from shape label to material.Parameters (1)theShapeLabel
- UnSetShapeMaterial(theShape: TopoDS_Shape): boolean
Removes a link with GUID
XCAFDoc::VisMaterialRefGUID()from shape label to material.Parameters (1)theShape
ReturnsTRUE if such link existed
- IsSetShapeMaterial(theLabel: TDF_Label): boolean
Returns TRUE if label has a material assignment.
Parameters (1)theLabel
- IsSetShapeMaterial(theShape: TopoDS_Shape): boolean
Returns TRUE if shape has a material assignment.
Parameters (1)theShape
- GetShapeMaterial(theShape: TopoDS_Shape): XCAFDoc_VisMaterial
Returns material assigned to shape or NULL if not assigned.
Parameters (1)theShape
- GetShapeMaterial(theShape: TopoDS_Shape, theMaterialLabel: TDF_Label): boolean
Returns label with material assigned to shape.
Parameters (2)theShape—shapetheMaterialLabel—material label Mutated in place; read the updated value from this argument after the call.
ReturnsFALSE if no material is assigned
- ID(): Standard_GUID
Returns GUID of this attribute type.
- Restore(anAttribute: TDF_Attribute): void
Does nothing.
Parameters (1)anAttribute
Creates new instance of this tool.
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
Does nothing.
Parameters (2)intoAttributeaRelocationTable
XCAFDoc_Volume
attribute to store volume
Constructors(1)
class methods
Static methods(6)
- Set(label: TDF_Label, value: number): XCAFDoc_Volume
Find, or create, an Volume attribute and set its value.
Parameters (2)labelvalue
- Set(label: TDF_Label, guid: Standard_GUID, value: number): TDataStd_Real
Sets a value of volume.
Parameters (3)labelguidvalue
Returns volume as argument returns false if no such attribute at the <label>.
Parameters (2)labelvol
ReturnsA result object with fields:
returnValue: the C++ return valuevol: updated value from the call.
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Returns the ID of the attribute.
- Set(V: number): void
Sets a value of volume.
Parameters (1)V
- Get(): number