OpenCascade.js
API ReferenceApplicationFrameworkTKCAF

TDataXtd

OCCT package TDataXtd: TDataXtd, TDataXtd_Axis, TDataXtd_Constraint, TDataXtd_ConstraintEnum, and 11 more bound classes.

TDataXtd

This package defines extension of standard attributes for modelling (mainly for work with geometry).

Constructors(1)

Static methods(1)

  • Appends to <anIDList> the list of the attributes IDs of this package. CAUTION: <anIDList> is NOT cleared before use.
    Print of TDataExt enumeration

    Parameters (1)
    • anIDList
      Mutated in place; read the updated value from this argument after the call.

TDataXtd_Axis

The basis to define an axis attribute.
Warning: Use TDataXtd_Geometry attribute to retrieve the gp_Lin of the Axis attribute

Constructors(1)

Static methods(5)

  • class methods
    Returns the GUID for an axis.

  • Finds or creates an axis attribute defined by the label. In the case of a creation of an axis, a compatible named shape should already be associated with label. Exceptions Standard_NullObject if no compatible named shape is associated with the label.

    Parameters (1)
    • label
  • Find, or create, an Axis attribute and set.
    as generated in the associated NamedShape.
    Axis methods

    Parameters (2)
    • label
    • L
  • get_type_name(): string

Instance methods(3)

TDataXtd_Constraint

The groundwork to define constraint attributes. The constraint attribute contains the following sorts of data:

  • Type whether the constraint attribute is a geometric constraint or a dimension
  • Value the real number value of a numeric constraint such as an angle or a radius
  • Geometries to identify the geometries underlying the topological attributes which define the constraint (up to 4)
  • Plane for 2D constraints.

Constructors(1)

Static methods(5)

Instance methods(28)

  • Finds or creates the constraint attribute defined by the topological attribute G1 and the constraint type type.

    Parameters (2)
    • type_
    • G1
  • Finds or creates the constraint attribute defined by the topological attributes G1 and G2, and by the constraint type type.

    Parameters (3)
    • type_
    • G1
    • G2
  • Finds or creates the constraint attribute defined by the topological attributes G1, G2 and G3, and by the constraint type type.

    Parameters (4)
    • type_
    • G1
    • G2
    • G3
  • Finds or creates the constraint attribute defined by the topological attributes G1, G2, G3 and G4, and by the constraint type type.
    methods to read constraint fields

    Parameters (5)
    • type_
    • G1
    • G2
    • G3
    • G4
  • Verified(): boolean

    Returns true if this constraint attribute is valid. By default, true is returned. When the value of a dimension is changed or when a geometry is moved, false is returned until the solver sets it back to true.

  • Verified(status: boolean): void

    Returns true if this constraint attribute defined by status is valid. By default, true is returned. When the value of a dimension is changed or when a geometry is moved, false is returned until the solver sets it back to true. If status is false, Verified is set to false.

    Parameters (1)
    • status
  • Returns the type of constraint. This will be an element of the TDataXtd_ConstraintEnum enumeration.

  • IsPlanar(): boolean

    Returns true if this constraint attribute is two-dimensional.

  • Returns the topological attribute of the plane used for planar - i.e., 2D - constraints. This plane is attached to another label. If the constraint is not planar, in other words, 3D, this function will return a null handle.

  • IsDimension(): boolean

    Returns true if this constraint attribute is a dimension, and therefore has a value.

  • Returns the value of a dimension. This value is a reference to a TDataStd_Real attribute. If the attribute is not a dimension, this value will be 0. Use IsDimension to test this condition.

  • NbGeometries(): number

    Returns the number of geometry attributes in this constraint attribute. This number will be between 1 and 4.

  • Returns the integer index Index used to access the array of the constraint or stored geometries of a dimension Index has a value between 1 and 4.
    methods to write constraint fields (use builder)

    Parameters (1)
    • Index
  • Removes the geometries involved in the constraint or dimension from the array of topological attributes where they are stored.

  • Finds or creates the type of constraint CTR.

    Parameters (1)
    • CTR
  • Finds or creates the plane of the 2D constraint attribute, defined by the planar topological attribute plane.

    Parameters (1)
    • plane
  • Finds or creates the real number value V of the dimension constraint attribute.

    Parameters (1)
    • V
  • SetGeometry(Index: number, G: TNaming_NamedShape): void

    Finds or creates the underlying geometry of the constraint defined by the topological attribute G and the integer index Index.

    Parameters (2)
    • Index
    • G
  • Inverted(status: boolean): void
    Parameters (1)
    • status
  • Inverted(): boolean
  • Reversed(status: boolean): void
    Parameters (1)
    • status
  • Reversed(): boolean
  • 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)
    • intoAttribute
    • aRelocationTable
  • 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

TDataXtd_ConstraintEnum

Properties(26)

TDataXtd_Geometry

This class is used to model construction geometry. The specific geometric construction of the attribute is defined by an element of the enumeration TDataXtd_GeometryEnum. This attribute may also be used to qualify underlying geometry of the associated NamedShape. for Constructuion element by example.

Constructors(1)

  • This and the next methods are used to retrieve underlying geometry of the NamedShape, even if no Geometry Attribute is associated. if not found or not compliant geometry return False.

Static methods(20)

  • API class methods
    Finds, or creates, a Geometry attribute defined by the label label. The default type of geometry is the value ANY_GEOM of the enumeration TDataXtd_GeometryEnum. To specify another value of this enumeration, use the function SetType.

    Parameters (1)
    • label
  • Returns the label L used to define the type of geometric construction for the geometry attribute.

    Parameters (1)
    • L
  • Returns the topological attribute S used to define the type of geometric construction for the geometry attribute.

    Parameters (1)
    • S
  • Point(L: TDF_Label, G: gp_Pnt): boolean

    Returns the point attribute defined by the label L and the point G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the point attribute defined by the topological attribute S and the point G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Axis(L: TDF_Label, G: gp_Ax1): boolean

    Returns the axis attribute defined by the label L and the axis G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Axis(S: TNaming_NamedShape, G: gp_Ax1): boolean

    Returns the axis attribute defined by the topological attribute S and the axis G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Line(L: TDF_Label, G: gp_Lin): boolean

    Returns the line attribute defined by the label L and the line G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Line(S: TNaming_NamedShape, G: gp_Lin): boolean

    Returns the line attribute defined by the topological attribute S and the line G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Circle(L: TDF_Label, G: gp_Circ): boolean

    Returns the circle attribute defined by the label L and the circle G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the circle attribute defined by the topological attribute S and the circle G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Ellipse(L: TDF_Label, G: gp_Elips): boolean

    Returns the ellipse attribute defined by the label L and the ellipse G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the ellipse attribute defined by the topological attribute S and the ellipse G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Plane(L: TDF_Label, G: gp_Pln): boolean

    Returns the plane attribute defined by the label L and the plane G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the plane attribute defined by the topological attribute S and the plane G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Cylinder(L: TDF_Label, G: gp_Cylinder): boolean

    Returns the cylinder attribute defined by the label L and the cylinder G.

    Parameters (2)
    • L
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the cylinder attribute defined by the topological attribute S and the cylinder G.

    Parameters (2)
    • S
    • G
      Mutated in place; read the updated value from this argument after the call.
  • Returns the GUID for geometry attributes.

  • get_type_name(): string

Instance methods(7)

  • Returns the type of geometric construction T of this attribute. T will be a value of the enumeration TDataXtd_GeometryEnum.

    Parameters (1)
    • T
  • Returns the type of geometric construction.

  • 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)
    • intoAttribute
    • aRelocationTable

TDataXtd_Pattern

a general pattern model

Static methods(3)

Instance methods(5)

TDataXtd_PatternStd

to create a PatternStd (LinearPattern, CircularPattern, RectangularPattern, RadialCircularPattern, MirrorPattern)

Constructors(1)

Static methods(4)

Instance methods(28)

TDataXtd_Placement

Constructors(1)

Static methods(4)

Instance methods(3)

TDataXtd_Plane

The basis to define a plane attribute. Warning: Use TDataXtd_Geometry attribute to retrieve the gp_Pln of the Plane attribute.

Constructors(1)

Static methods(5)

Instance methods(3)

TDataXtd_Point

The basis to define a point attribute. The topological attribute must contain a vertex. You use this class to create reference points in a design.
Warning: Use TDataXtd_Geometry attribute to retrieve the gp_Pnt of the Point attribute

Constructors(1)

Static methods(5)

Instance methods(3)

TDataXtd_Position

Position of a Label.

Constructors(1)

Static methods(6)

Instance methods(7)

  • Returns the ID of the attribute.

  • Restore(anAttribute: TDF_Attribute): void

    Restores the 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 pastes the current attribute to the label corresponding to the insertor. The pasted attribute may be a brand new one or a new version of the previous one.

    Parameters (2)
    • intoAttribute
    • aRelocationTable
  • SetPosition(aPos: gp_Pnt): void
    Parameters (1)
    • aPos

TDataXtd_Presentation

Attribute containing parameters of presentation of the shape, e.g. the shape attached to the same label and displayed using TPrsStd tools (see TPrsStd_AISPresentation).

Constructors(1)

Static methods(7)

Instance methods(36)

TDataXtd_Shape

A Shape is associated in the framework with : a NamedShape attribute.

Constructors(1)

Static methods(7)

  • Find(current: TDF_Label): { returnValue: boolean; S: TDataXtd_Shape; [Symbol.dispose](): void }

    class methods
    try to retrieve a Shape attribute at <current> label or in fathers label of <current>. Returns True if found and set .

    Parameters (1)
    • current
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • S: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Find, or create, a Shape attribute. the Shape attribute is returned. Raises if <label> has attribute.

    Parameters (1)
    • label
  • Create or update associated NamedShape attribute. the Shape attribute is returned.

    Parameters (2)
    • label
    • shape
  • the Shape from associated NamedShape attribute is returned.

    Parameters (1)
    • label
  • Shape methods

  • get_type_name(): string

Instance methods(4)

TDataXtd_Triangulation

An Ocaf attribute containing a mesh (Poly_Triangulation). It duplicates all methods from Poly_Triangulation. It is highly recommended to modify the mesh through the methods of this attribute, but not directly via the underlying Poly_Triangulation object. In this case Undo/Redo will work fine and robust.

Constructors(1)

  • Object methods.
    A constructor. Don't use it directly, use please the static method Set(), which returns the attribute attached to a label.

Static methods(5)

Instance methods(22)

  • Set(theTriangulation: Poly_Triangulation): void

    Sets the triangulation.

    Parameters (1)
    • theTriangulation
  • Returns the underlying triangulation.

  • Deflection(): number

    Poly_Triangulation methods.
    The methods are "covered" by this attribute to prevent direct modification of the mesh. There is no performance problem to call Poly_Triangulation method through this attribute. The most of the methods are considered as "inline" by the compiler in release mode. Returns the deflection of this triangulation.

  • Deflection(theDeflection: number): void

    Sets the deflection of this triangulation to theDeflection. See more on deflection in Polygon2D.

    Parameters (1)
    • theDeflection
  • Deallocates the UV nodes.

  • NbNodes(): number
    Returns

    the number of nodes for this triangulation.

  • NbTriangles(): number
    Returns

    the number of triangles for this triangulation.

  • HasUVNodes(): boolean
    Returns

    true if 2D nodes are associated with 3D nodes for this triangulation.

  • Node(theIndex: number): gp_Pnt
    Parameters (1)
    • theIndex
    Returns

    node at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes.

  • SetNode(theIndex: number, theNode: gp_Pnt): void

    The method differs from Poly_Triangulation! Sets a node at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes.

    Parameters (2)
    • theIndex
    • theNode
  • UVNode(theIndex: number): gp_Pnt2d
    Parameters (1)
    • theIndex
    Returns

    UVNode at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes.

  • SetUVNode(theIndex: number, theUVNode: gp_Pnt2d): void

    The method differs from Poly_Triangulation! Sets a UVNode at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbNodes.

    Parameters (2)
    • theIndex
    • theUVNode
  • Triangle(theIndex: number): Poly_Triangle
    Parameters (1)
    • theIndex
    Returns

    triangle at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbTriangles.

  • SetTriangle(theIndex: number, theTriangle: Poly_Triangle): void

    The method differs from Poly_Triangulation! Sets a triangle at the given index. Raises Standard_OutOfRange exception if theIndex is less than 1 or greater than NbTriangles.

    Parameters (2)
    • theIndex
    • theTriangle
  • SetNormal(theIndex: number, theNormal: gp_Dir): void

    Changes normal at the given index. Raises Standard_OutOfRange exception.

    Parameters (2)
    • theIndex
    • theNormal
  • HasNormals(): boolean

    Returns true if nodal normals are defined.

  • Normal(theIndex: number): gp_Dir
    Parameters (1)
    • theIndex
    Returns

    normal at the given index. Raises Standard_OutOfRange exception.

  • Inherited attribute methods.

  • 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)
    • intoAttribute
    • aRelocationTable