OpenCascade.js
API ReferenceModelingDataTKBRep

BinTools

OCCT package BinTools: BinTools, BinTools_Curve2dSet, BinTools_CurveSet, BinTools_FormatVersion, and 9 more bound classes.

BinTools

Tool to keep shapes in binary format.

Constructors(1)

Static methods(3)

  • Write(theShape: TopoDS_Shape, theFile: string, theRange: Message_ProgressRange): boolean

    Writes the shape to the file in binary format BinTools_FormatVersion_CURRENT.

    Parameters (3)
    • theShape
      the shape to write
    • theFile
      the path to file to output shape into
    • theRange
      the range of progress indicator to fill in
  • Write(theShape: TopoDS_Shape, theFile: string, theWithTriangles: boolean, theWithNormals: boolean, theVersion: BinTools_FormatVersion, theRange: Message_ProgressRange): boolean

    Writes the shape to the file in binary format of specified version.

    Parameters (6)
    • theShape
      the shape to write
    • theFile
      the path to file to output shape into
    • theWithTriangles
      flag which specifies whether to save shape with (TRUE) or without (FALSE) triangles; has no effect on triangulation-only geometry
    • theWithNormals
      flag which specifies whether to save triangulation with (TRUE) or without (FALSE) normals; has no effect on triangulation-only geometry
    • theVersion
      the BinTools format version
    • theRange
      the range of progress indicator to fill in
  • Read(theShape: TopoDS_Shape, theFile: string, theRange: Message_ProgressRange): boolean

    Reads a shape from <theStream> and returns it in <theShape>.

    Parameters (3)
    • theShape
      Mutated in place; read the updated value from this argument after the call.
    • theFile
    • theRange

BinTools_Curve2dSet

Stores a set of Curves from Geom2d in binary format.

Constructors(1)

Static methods(1)

Instance methods(4)

  • Clear(): void

    Clears the content of the set.

  • Add(C: Geom2d_Curve): number

    Incorporate a new Curve in the set and returns its index.

    Parameters (1)
    • C
  • Curve2d(I: number): Geom2d_Curve

    Returns the Curve of index .

    Parameters (1)
    • I
  • Index(C: Geom2d_Curve): number

    Returns the index of <L>.

    Parameters (1)
    • C

BinTools_CurveSet

Stores a set of Curves from Geom in binary format.

Constructors(1)

Static methods(1)

Instance methods(4)

  • Clear(): void

    Clears the content of the set.

  • Add(C: Geom_Curve): number

    Incorporate a new Curve in the set and returns its index.

    Parameters (1)
    • C
  • Curve(I: number): Geom_Curve

    Returns the Curve of index .

    Parameters (1)
    • I
  • Index(C: Geom_Curve): number

    Returns the index of <L>.

    Parameters (1)
    • C

BinTools_IStream

Substitution of IStream for shape reader for fast management of position in the file (get and go) and operation on all reading types.

Instance methods(17)

  • Reads and returns the type.

  • Returns the last read type.

  • Returns the shape type by the last retrieved type.

  • Returns the shape orientation by the last retrieved type.

  • Position(): number

    Returns the current position in the stream.

  • GoTo(thePosition: number): void

    Moves the current stream position to the given one.

    Parameters (1)
    • thePosition
  • IsReference(): boolean

    Returns true if the last restored type is one of a reference.

  • ReadReference(): number

    Reads a reference IStream using the last restored type.

  • Makes up to date the myPosition because myStream was used outside and position is changed.

  • ReadReal(): number

    Reads real value from the stream.

  • ReadInteger(): number

    Reads integer value from the stream.

  • Reads point coordinates value from the stream.

  • ReadByte(): number

    Reads byte value from the stream.

  • ReadBool(): boolean

    Reads boolean value from the stream (stored as one byte).

  • ReadShortReal(): number

    Reads short real value from the stream.

  • ReadBools(theBool1: boolean, theBool2: boolean, theBool3: boolean): { theBool1: boolean; theBool2: boolean; theBool3: boolean }

    Reads 3 boolean values from one byte.

    Parameters (3)
    • theBool1
    • theBool2
    • theBool3
    Returns

    A result object with fields:

    • theBool1: updated value from the call.
    • theBool2: updated value from the call.
    • theBool3: updated value from the call.
  • ReadBools(theBool1: boolean, theBool2: boolean, theBool3: boolean, theBool4: boolean, theBool5: boolean, theBool6: boolean, theBool7: boolean): { theBool1: boolean; theBool2: boolean; theBool3: boolean; theBool4: boolean; theBool5: boolean; theBool6: boolean; theBool7: boolean }

    Reads 7 boolean values from one byte.

    Parameters (7)
    • theBool1
    • theBool2
    • theBool3
    • theBool4
    • theBool5
    • theBool6
    • theBool7
    Returns

    A result object with fields:

    • theBool1: updated value from the call.
    • theBool2: updated value from the call.
    • theBool3: updated value from the call.
    • theBool4: updated value from the call.
    • theBool5: updated value from the call.
    • theBool6: updated value from the call.
    • theBool7: updated value from the call.

BinTools_LocationSet

The class LocationSet stores a set of location in a relocatable state.
It can be created from Locations.
It can create Locations.

Constructors(1)

Instance methods(5)

BinTools_ObjectType

Properties(23)

BinTools_OStream

Substitution of OStream for shape writer for fast management of position in the file and operation on all writing types.

Instance methods(5)

  • Position(): number

    Returns the current position of the stream.

  • WriteReference(thePosition: number): void

    Writes the reference to the given position (an offset between the current and the given one).

    Parameters (1)
    • thePosition
  • WriteShape(theType: TopAbs_ShapeEnum, theOrientation: TopAbs_Orientation): void

    Writes an identifier of shape type and orientation into the stream.

    Parameters (2)
    • theType
    • theOrientation
  • PutBools(theValue1: boolean, theValue2: boolean, theValue3: boolean): void

    Writes 3 booleans as one byte to the stream.

    Parameters (3)
    • theValue1
    • theValue2
    • theValue3
  • PutBools(theValue1: boolean, theValue2: boolean, theValue3: boolean, theValue4: boolean, theValue5: boolean, theValue6: boolean, theValue7: boolean): void

    Writes 7 booleans as one byte to the stream.

    Parameters (7)
    • theValue1
    • theValue2
    • theValue3
    • theValue4
    • theValue5
    • theValue6
    • theValue7

BinTools_ShapeSet

Writes topology in OStream in binary format.

Constructors(1)

Instance methods(9)

BinTools_ShapeSetBase

A base class for all readers/writers of TopoDS_Shape into/from stream.

Constructors(1)

Instance methods(7)

  • IsWithTriangles(): boolean

    Return true if shape should be stored with triangles.

  • IsWithNormals(): boolean

    Return true if shape should be stored triangulation with normals.

  • SetWithTriangles(theWithTriangles: boolean): void

    Define if shape will be stored with triangles. Ignored (always written) if face defines only triangulation (no surface).

    Parameters (1)
    • theWithTriangles
  • SetWithNormals(theWithNormals: boolean): void

    Define if shape will be stored triangulation with normals. Ignored (always written) if face defines only triangulation (no surface).

    Parameters (1)
    • theWithNormals
  • SetFormatNb(theFormatNb: number): void

    Sets the BinTools_FormatVersion.

    Parameters (1)
    • theFormatNb
  • FormatNb(): number

    Returns the BinTools_FormatVersion.

  • Clear(): void

    Clears the content of the set.

BinTools_ShapeWriter

Writes topology in OStream in binary format without grouping of objects by types and using relative positions in a file as references.

Constructors(1)

Instance methods(2)

  • Clear(): void

    Clears the content of the set.

  • WriteLocation(theStream: BinTools_OStream, theLocation: TopLoc_Location): void

    Writes location to the stream (all the needed sub-information or reference if it is already used).

    Parameters (2)
    • theStream
    • theLocation

BinTools_SurfaceSet

Stores a set of Surfaces from Geom in binary format.

Constructors(1)

Static methods(1)

Instance methods(4)

  • Clear(): void

    Clears the content of the set.

  • Add(S: Geom_Surface): number

    Incorporate a new Surface in the set and returns its index.

    Parameters (1)
    • S
  • Surface(I: number): Geom_Surface

    Returns the Surface of index .

    Parameters (1)
    • I
  • Index(S: Geom_Surface): number

    Returns the index of <L>.

    Parameters (1)
    • S