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 writetheFile—the path to file to output shape intotheRange—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 writetheFile—the path to file to output shape intotheWithTriangles—flag which specifies whether to save shape with (TRUE) or without (FALSE) triangles; has no effect on triangulation-only geometrytheWithNormals—flag which specifies whether to save triangulation with (TRUE) or without (FALSE) normals; has no effect on triangulation-only geometrytheVersion—theBinToolsformat versiontheRange—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.theFiletheRange
BinTools_Curve2dSet
Stores a set of Curves from Geom2d in binary format.
Constructors(1)
Returns an empty set of Curves.
Static methods(1)
- WriteCurve2d(C: Geom2d_Curve, OS: BinTools_OStream): void
Dumps the curve on the binary stream, that can be read back.
Parameters (2)COS
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)
Returns an empty set of Curves.
Static methods(1)
- WriteCurve(C: Geom_Curve, OS: BinTools_OStream): void
Dumps the curve on the stream in binary format that can be read back.
Parameters (2)COS
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_FormatVersion
Properties(5)
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.
- UpdatePosition(): void
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)theBool1theBool2theBool3
ReturnsA 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)theBool1theBool2theBool3theBool4theBool5theBool6theBool7
ReturnsA 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)
Returns an empty set of locations.
Instance methods(5)
- Clear(): void
Clears the content of the set.
- Add(L: TopLoc_Location): number
Incorporate a new Location in the set and returns its index.
Parameters (1)L
- Location(I: number): TopLoc_Location
Returns the location of index .
Parameters (1)I
- Index(L: TopLoc_Location): number
Returns the index of <L>.
Parameters (1)L
- NbLocations(): number
Returns number of locations.
BinTools_ObjectType
Properties(23)
- BinTools_ObjectType_EmptyPolygonOnTriangulation:'BinTools_ObjectType_EmptyPolygonOnTriangulation'readonly
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)theTypetheOrientation
- PutBools(theValue1: boolean, theValue2: boolean, theValue3: boolean): void
Writes 3 booleans as one byte to the stream.
Parameters (3)theValue1theValue2theValue3
- 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)theValue1theValue2theValue3theValue4theValue5theValue6theValue7
BinTools_ShapeReader
Reads topology from IStream in binary format without grouping of objects by types and using relative positions in a file as references.
Constructors(1)
Initializes a shape reader.
Instance methods(2)
- Clear(): void
Clears the content of the set.
- ReadLocation(theStream: BinTools_IStream): TopLoc_Location
Reads location from the stream.
Parameters (1)theStream
BinTools_ShapeSet
Writes topology in OStream in binary format.
Constructors(1)
Builds an empty ShapeSet.
Instance methods(9)
- Clear(): void
Clears the content of the set.
- Add(S: TopoDS_Shape): number
Stores and its sub-shape. Returns the index of . The method AddGeometry is called on each sub-shape.
Parameters (1)S
- Shape(I: number): TopoDS_Shape
Returns the sub-shape of index .
Parameters (1)I
- Index(S: TopoDS_Shape): number
Returns the index of .
Parameters (1)S
- NbShapes(): number
Returns number of shapes read from file.
- AddShape(S: TopoDS_Shape): void
Stores the shape .
Parameters (1)S
- AddShapes(S1: TopoDS_Shape, S2: TopoDS_Shape): void
Inserts the shape <S2> in the shape <S1>.
Parameters (2)S1—Mutated in place; read the updated value from this argument after the call.S2
BinTools_ShapeSetBase
A base class for all readers/writers of TopoDS_Shape into/from stream.
Constructors(1)
A default constructor.
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)
Builds an empty ShapeSet. Parameter <theWithTriangles> is added for XML Persistence.
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)theStreamtheLocation
BinTools_SurfaceSet
Stores a set of Surfaces from Geom in binary format.
Constructors(1)
Returns an empty set of Surfaces.
Static methods(1)
- WriteSurface(S: Geom_Surface, OS: BinTools_OStream): void
Dumps the surface on the stream in binary format that can be read back.
Parameters (2)SOS
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