mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
215
src/TopTools/TopTools.cdl
Executable file
215
src/TopTools/TopTools.cdl
Executable file
@@ -0,0 +1,215 @@
|
||||
-- File: TopTools.cdl
|
||||
-- Created: Thu Jan 14 11:35:23 1993
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
package TopTools
|
||||
|
||||
---Purpose: The TopTools package provides utilities for the
|
||||
-- topological data structure.
|
||||
--
|
||||
-- * ShapeMapHasher. Hash a Shape base on the TShape
|
||||
-- and the Location. The Orientation is not used.
|
||||
--
|
||||
-- * OrientedShapeMapHasher. Hash a Shape base on the
|
||||
-- TShape ,the Location and the Orientation.
|
||||
--
|
||||
-- * Instantiations of TCollection for Shapes :
|
||||
-- MapOfShape
|
||||
-- IndexedMapOfShape
|
||||
-- DataMapOfIntegerShape
|
||||
-- DataMapOfShapeInteger
|
||||
-- DataMapOfShapeReal
|
||||
-- Array1OfShape
|
||||
-- HArray1OfShape
|
||||
-- SequenceOfShape
|
||||
-- HSequenceOfShape
|
||||
-- ListOfShape
|
||||
-- Array1OfListShape
|
||||
-- HArray1OfListShape
|
||||
-- DataMapOfIntegerListOfShape
|
||||
-- DataMapOfShapeListOfShape
|
||||
-- DataMapOfShapeListOfInteger
|
||||
-- IndexedDataMapOfShapeShape
|
||||
-- IndexedDataMapOfShapeListOfShape
|
||||
-- DataMapOfShapeShape
|
||||
-- IndexedMapOfOrientedShape
|
||||
-- DataMapOfShapeSequenceOfShape
|
||||
-- IndexedDataMapOfShapeAddress
|
||||
-- DataMapOfOrientedShapeShape
|
||||
--
|
||||
-- * LocationSet : to write sets of locations.
|
||||
--
|
||||
-- * ShapeSet : to writes sets of TShapes.
|
||||
--
|
||||
-- Package Methods :
|
||||
--
|
||||
-- Dump : To dump the topology of a Shape.
|
||||
--
|
||||
|
||||
--- Level : Public
|
||||
-- All methods of all classes will be public.
|
||||
|
||||
|
||||
uses
|
||||
|
||||
MMgt,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TopLoc,
|
||||
TopAbs,
|
||||
TopoDS,
|
||||
Message
|
||||
|
||||
is
|
||||
|
||||
----------------------------------------------------------
|
||||
-- TCollections for Shapes
|
||||
----------------------------------------------------------
|
||||
|
||||
class ShapeMapHasher;
|
||||
|
||||
class OrientedShapeMapHasher;
|
||||
|
||||
class MapOfShape instantiates
|
||||
Map from TCollection(Shape from TopoDS,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class MapOfOrientedShape instantiates
|
||||
Map from TCollection(Shape from TopoDS,
|
||||
OrientedShapeMapHasher from TopTools);
|
||||
|
||||
class IndexedMapOfShape instantiates
|
||||
IndexedMap from TCollection(Shape from TopoDS,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfIntegerShape instantiates
|
||||
DataMap from TCollection(Integer,
|
||||
Shape from TopoDS,
|
||||
MapIntegerHasher from TColStd);
|
||||
|
||||
class DataMapOfOrientedShapeInteger instantiates
|
||||
DataMap from TCollection(Shape from TopoDS,
|
||||
Integer from Standard,
|
||||
OrientedShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfShapeInteger instantiates
|
||||
DataMap from TCollection(Shape from TopoDS,
|
||||
Integer from Standard,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfShapeReal instantiates
|
||||
DataMap from TCollection(Shape from TopoDS,
|
||||
Real from Standard,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class Array1OfShape instantiates
|
||||
Array1 from TCollection (Shape from TopoDS);
|
||||
|
||||
class HArray1OfShape instantiates
|
||||
HArray1 from TCollection(Shape from TopoDS,
|
||||
Array1OfShape from TopTools);
|
||||
|
||||
class Array2OfShape instantiates
|
||||
Array2 from TCollection (Shape from TopoDS);
|
||||
|
||||
class HArray2OfShape instantiates
|
||||
HArray2 from TCollection(Shape from TopoDS,
|
||||
Array2OfShape from TopTools);
|
||||
|
||||
class SequenceOfShape instantiates
|
||||
Sequence from TCollection (Shape from TopoDS);
|
||||
|
||||
class HSequenceOfShape instantiates
|
||||
HSequence from TCollection(Shape from TopoDS,
|
||||
SequenceOfShape from TopTools);
|
||||
|
||||
class ListOfShape instantiates
|
||||
List from TCollection (Shape from TopoDS);
|
||||
|
||||
class Array1OfListOfShape instantiates
|
||||
Array1 from TCollection (ListOfShape from TopTools);
|
||||
|
||||
class HArray1OfListOfShape instantiates
|
||||
HArray1 from TCollection(ListOfShape from TopTools,
|
||||
Array1OfListOfShape from TopTools);
|
||||
|
||||
class DataMapOfIntegerListOfShape instantiates
|
||||
DataMap from TCollection(Integer from Standard,
|
||||
ListOfShape from TopTools,
|
||||
MapIntegerHasher from TColStd);
|
||||
|
||||
class DataMapOfShapeListOfShape instantiates
|
||||
DataMap from TCollection(Shape from TopoDS,
|
||||
ListOfShape from TopTools,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfShapeListOfInteger instantiates
|
||||
DataMap from TCollection(Shape from TopoDS,
|
||||
ListOfInteger from TColStd,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class IndexedDataMapOfShapeShape instantiates
|
||||
IndexedDataMap from TCollection(Shape from TopoDS,
|
||||
Shape from TopoDS,
|
||||
ShapeMapHasher from TopTools);
|
||||
class IndexedDataMapOfShapeListOfShape instantiates
|
||||
IndexedDataMap from TCollection(Shape from TopoDS,
|
||||
ListOfShape from TopTools,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfShapeShape instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
Shape from TopoDS,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class IndexedMapOfOrientedShape instantiates
|
||||
IndexedMap from TCollection(Shape from TopoDS,
|
||||
OrientedShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfShapeSequenceOfShape instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
SequenceOfShape from TopTools,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class IndexedDataMapOfShapeAddress instantiates
|
||||
IndexedDataMap from TCollection(Shape from TopoDS,
|
||||
Address from Standard,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfOrientedShapeShape instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
Shape from TopoDS,
|
||||
OrientedShapeMapHasher from TopTools);
|
||||
|
||||
----------------------------------------------------------
|
||||
-- Tools for writing and reading Locations and Shapes
|
||||
----------------------------------------------------------
|
||||
|
||||
class LocationSet;
|
||||
---Purpose: A set of Locations. Can be dump, wrote or read.
|
||||
|
||||
pointer LocationSetPtr to LocationSet from TopTools;
|
||||
|
||||
class ShapeSet;
|
||||
---Purpose: A set of Shapes. Can be dump, wrote or read.
|
||||
|
||||
--
|
||||
-- Package methods
|
||||
--
|
||||
|
||||
Dump(Sh : Shape from TopoDS; S : in out OStream);
|
||||
---Purpose: Dumps the topological structure of <Sh> on the
|
||||
-- stream <S>.
|
||||
|
||||
Dummy(I : Integer);
|
||||
---Purpose: This is to bypass an extraction bug. It will force
|
||||
-- the inclusion of Standard_Integer.hxx itself
|
||||
-- including Standard_OStream.hxx at the correct
|
||||
-- position.
|
||||
|
||||
end TopTools;
|
||||
|
||||
|
26
src/TopTools/TopTools.cxx
Executable file
26
src/TopTools/TopTools.cxx
Executable file
@@ -0,0 +1,26 @@
|
||||
// File: TopTools.cxx
|
||||
// Created: Wed Jan 20 20:04:06 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopTools.ixx>
|
||||
#include <TopTools_ShapeSet.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools::Dump(const TopoDS_Shape& Sh, Standard_OStream& S)
|
||||
{
|
||||
TopTools_ShapeSet SSet;
|
||||
SSet.Add(Sh);
|
||||
SSet.Dump(Sh,S);
|
||||
SSet.Dump(S);
|
||||
}
|
||||
|
||||
|
||||
void TopTools::Dummy(const Standard_Integer)
|
||||
{
|
||||
}
|
78
src/TopTools/TopTools_LocationSet.cdl
Executable file
78
src/TopTools/TopTools_LocationSet.cdl
Executable file
@@ -0,0 +1,78 @@
|
||||
-- File: TopTools_LocationSet.cdl
|
||||
-- Created: Fri Jul 16 16:52:20 1993
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@nonox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class LocationSet from TopTools
|
||||
|
||||
---Purpose: The class LocationSet stores a set of location in
|
||||
-- a relocatable state.
|
||||
--
|
||||
-- It can be created from Locations.
|
||||
--
|
||||
-- It can create Locations.
|
||||
--
|
||||
-- It can be write and read from a stream.
|
||||
|
||||
uses
|
||||
Location from TopLoc,
|
||||
IndexedMapOfLocation from TopLoc,
|
||||
ProgressIndicator from Message
|
||||
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns LocationSet from TopTools;
|
||||
---Purpose: Returns an empty set of locations.
|
||||
|
||||
Clear(me : in out)
|
||||
---Purpose: Clears the content of the set.
|
||||
is static;
|
||||
|
||||
Add(me : in out; L : Location from TopLoc) returns Integer
|
||||
---Purpose: Incorporate a new Location in the set and returns
|
||||
-- its index.
|
||||
is static;
|
||||
|
||||
Location(me; I : Integer) returns Location from TopLoc
|
||||
---Purpose: Returns the location of index <I>.
|
||||
--
|
||||
---C++: return const &
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
Index(me; L : Location from TopLoc) returns Integer
|
||||
---Purpose: Returns the index of <L>.
|
||||
is static;
|
||||
|
||||
Dump(me; OS : in out OStream)
|
||||
---Purpose: Dumps the content of me on the stream <OS>.
|
||||
is static;
|
||||
|
||||
Write(me; OS : in out OStream)
|
||||
---Purpose: Writes the content of me on the stream <OS> in a
|
||||
-- format that can be read back by Read.
|
||||
is static;
|
||||
|
||||
Read(me : in out; IS : in out IStream)
|
||||
---Purpose: Reads the content of me from the stream <IS>. me
|
||||
-- is first cleared.
|
||||
--
|
||||
is static;
|
||||
|
||||
SetProgress(me : in out; PR : ProgressIndicator from Message);
|
||||
|
||||
GetProgress(me) returns ProgressIndicator from Message;
|
||||
|
||||
fields
|
||||
myMap : IndexedMapOfLocation from TopLoc;
|
||||
myProgress : ProgressIndicator from Message;
|
||||
|
||||
end LocationSet;
|
||||
|
||||
|
299
src/TopTools/TopTools_LocationSet.cxx
Executable file
299
src/TopTools/TopTools_LocationSet.cxx
Executable file
@@ -0,0 +1,299 @@
|
||||
// File: TopTools_LocationSet.cxx
|
||||
// Created: Fri Jul 16 17:51:59 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@nonox>
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <TopTools_LocationSet.ixx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TopTools_LocationSet
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopTools_LocationSet::TopTools_LocationSet()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_LocationSet::Clear()
|
||||
{
|
||||
myMap.Clear();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TopTools_LocationSet::Add(const TopLoc_Location& L)
|
||||
{
|
||||
if (L.IsIdentity()) return 0;
|
||||
Standard_Integer n = myMap.FindIndex(L);
|
||||
if (n > 0) return n;
|
||||
TopLoc_Location N = L;
|
||||
do {
|
||||
myMap.Add(N.FirstDatum());
|
||||
N = N.NextLocation();
|
||||
} while (!N.IsIdentity());
|
||||
return myMap.Add(L);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Location
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopLoc_Location& TopTools_LocationSet::Location
|
||||
(const Standard_Integer I)const
|
||||
{
|
||||
static TopLoc_Location identity;
|
||||
if (I <= 0 || I > myMap.Extent()) return identity;
|
||||
return myMap(I);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Index
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TopTools_LocationSet::Index(const TopLoc_Location& L) const
|
||||
{
|
||||
if (L.IsIdentity()) return 0;
|
||||
return myMap.FindIndex(L);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void WriteTrsf(const gp_Trsf& T,
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean compact)
|
||||
{
|
||||
gp_XYZ V = T.TranslationPart();
|
||||
gp_Mat M = T.VectorialPart();
|
||||
|
||||
if (!compact) OS << "( ";
|
||||
OS << setw(15) << M(1,1) << " ";
|
||||
OS << setw(15) << M(1,2) << " ";
|
||||
OS << setw(15) << M(1,3) << " ";
|
||||
OS << setw(15) << V.Coord(1) << " ";
|
||||
if (!compact) OS << " )";
|
||||
OS << "\n";
|
||||
if (!compact) OS << "( ";
|
||||
OS << setw(15) << M(2,1) << " ";
|
||||
OS << setw(15) << M(2,2) << " ";
|
||||
OS << setw(15) << M(2,3) << " ";
|
||||
OS << setw(15) << V.Coord(2) << " ";
|
||||
if (!compact) OS << " )";
|
||||
OS << "\n";
|
||||
if (!compact) OS << "( ";
|
||||
OS << setw(15) << M(3,1) << " ";
|
||||
OS << setw(15) << M(3,2) << " ";
|
||||
OS << setw(15) << M(3,3) << " ";
|
||||
OS << setw(15) << V.Coord(3) << " ";
|
||||
if (!compact) OS << " )";
|
||||
OS << "\n";
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_LocationSet::Dump(Standard_OStream& OS) const
|
||||
{
|
||||
Standard_Integer i, nbLoc = myMap.Extent();
|
||||
|
||||
OS << "\n\n";
|
||||
OS << "\n -------";
|
||||
OS << "\n Dump of "<< nbLoc << " Locations";
|
||||
OS << "\n -------\n\n";
|
||||
|
||||
for (i = 1; i <= nbLoc; i++) {
|
||||
TopLoc_Location L = myMap(i);
|
||||
OS << setw(5) << i << " : \n";
|
||||
|
||||
TopLoc_Location L2 = L.NextLocation();
|
||||
Standard_Boolean simple = L2.IsIdentity();
|
||||
Standard_Integer p = L.FirstPower();
|
||||
TopLoc_Location L1 = L.FirstDatum();
|
||||
Standard_Boolean elementary = (simple && p == 1);
|
||||
if (elementary) {
|
||||
OS << "Elementary location\n";
|
||||
}
|
||||
else {
|
||||
OS << "Complex : L"<<myMap.FindIndex(L1);
|
||||
if (p != 1) OS <<"^"<<p;
|
||||
while (!L2.IsIdentity()) {
|
||||
L1 = L2.FirstDatum();
|
||||
p = L2.FirstPower();
|
||||
L2 = L2.NextLocation();
|
||||
OS << " * L" << myMap.FindIndex(L1);
|
||||
if (p != 1) OS << "^"<<p;
|
||||
}
|
||||
OS <<"\n";
|
||||
}
|
||||
WriteTrsf(L.Transformation(),OS,Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_LocationSet::Write(Standard_OStream& OS) const
|
||||
{
|
||||
|
||||
int prec = OS.precision(15);
|
||||
|
||||
Standard_Integer i, nbLoc = myMap.Extent();
|
||||
OS << "Locations " << nbLoc << "\n";
|
||||
|
||||
//OCC19559
|
||||
Message_ProgressSentry PS(GetProgress(), "Locations", 0, nbLoc, 1);
|
||||
|
||||
for (i = 1; i <= nbLoc && PS.More(); i++, PS.Next()) {
|
||||
if ( !GetProgress().IsNull() )
|
||||
GetProgress()->Show();
|
||||
|
||||
TopLoc_Location L = myMap(i);
|
||||
|
||||
|
||||
TopLoc_Location L2 = L.NextLocation();
|
||||
Standard_Boolean simple = L2.IsIdentity();
|
||||
Standard_Integer p = L.FirstPower();
|
||||
TopLoc_Location L1 = L.FirstDatum();
|
||||
Standard_Boolean elementary = (simple && p == 1);
|
||||
if (elementary) {
|
||||
OS << "1\n";
|
||||
WriteTrsf(L.Transformation(),OS,Standard_True);
|
||||
}
|
||||
else {
|
||||
OS << "2 ";
|
||||
OS << " "<<myMap.FindIndex(L1) << " "<<p;
|
||||
while (!L2.IsIdentity()) {
|
||||
L1 = L2.FirstDatum();
|
||||
p = L2.FirstPower();
|
||||
L2 = L2.NextLocation();
|
||||
OS << " "<<myMap.FindIndex(L1) << " "<<p;
|
||||
}
|
||||
OS << " 0\n";
|
||||
}
|
||||
}
|
||||
OS.precision(prec);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void ReadTrsf(gp_Trsf& T,
|
||||
Standard_IStream& IS)
|
||||
{
|
||||
Standard_Real V1[3],V2[3],V3[3];
|
||||
Standard_Real V[3];
|
||||
|
||||
IS >> V1[0] >> V1[1] >> V1[2] >> V[0];
|
||||
IS >> V2[0] >> V2[1] >> V2[2] >> V[1];
|
||||
IS >> V3[0] >> V3[1] >> V3[2] >> V[2];
|
||||
|
||||
T.SetValues(V1[0],V1[1],V1[2],V[0],
|
||||
V2[0],V2[1],V2[2],V[1],
|
||||
V3[0],V3[1],V3[2],V[2],
|
||||
Precision::Angular(),
|
||||
Precision::Confusion());
|
||||
return;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_LocationSet::Read(Standard_IStream& IS)
|
||||
{
|
||||
myMap.Clear();
|
||||
|
||||
char buffer[255];
|
||||
Standard_Integer l1,p;
|
||||
|
||||
IS >> buffer;
|
||||
if (strcmp(buffer,"Locations")) {
|
||||
cout << "Not a location table "<<endl;
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Integer i, nbLoc;
|
||||
IS >> nbLoc;
|
||||
|
||||
TopLoc_Location L;
|
||||
gp_Trsf T;
|
||||
|
||||
//OCC19559
|
||||
Message_ProgressSentry PS(GetProgress(), "Locations", 0, nbLoc, 1);
|
||||
for (i = 1; i <= nbLoc&& PS.More(); i++, PS.Next()) {
|
||||
if ( !GetProgress().IsNull() )
|
||||
GetProgress()->Show();
|
||||
|
||||
Standard_Integer typLoc;
|
||||
IS >> typLoc;
|
||||
|
||||
if (typLoc == 1) {
|
||||
ReadTrsf(T,IS);
|
||||
L = T;
|
||||
}
|
||||
|
||||
else if (typLoc == 2) {
|
||||
L = TopLoc_Location();
|
||||
IS >> l1;
|
||||
while (l1 != 0) {
|
||||
IS >> p;
|
||||
TopLoc_Location L1 = myMap(l1);
|
||||
L = L1.Powered(p) *L;
|
||||
IS >> l1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!L.IsIdentity()) myMap.Add(L);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Message_ProgressIndicator) TopTools_LocationSet::GetProgress() const
|
||||
{
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_LocationSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
|
||||
{
|
||||
myProgress = PR;
|
||||
}
|
||||
|
||||
|
29
src/TopTools/TopTools_OrientedShapeMapHasher.cdl
Executable file
29
src/TopTools/TopTools_OrientedShapeMapHasher.cdl
Executable file
@@ -0,0 +1,29 @@
|
||||
-- File: TopTools_OrientedShapeMapHasher.cdl
|
||||
-- Created: Mon Aug 30 16:10:24 1993
|
||||
-- Author: Modelistation
|
||||
-- <model@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class OrientedShapeMapHasher from TopTools
|
||||
|
||||
uses
|
||||
Shape from TopoDS
|
||||
|
||||
is
|
||||
|
||||
HashCode(myclass; S : Shape from TopoDS; Upper : Integer) returns Integer;
|
||||
---Purpose: Returns a HasCode value for the Key <K> in the
|
||||
-- range 0..Upper.
|
||||
--
|
||||
---C++: inline
|
||||
|
||||
IsEqual(myclass; S1, S2 : Shape from TopoDS) returns Boolean;
|
||||
---Purpose: Returns True when the two keys are equal. Two same
|
||||
-- keys must have the same hashcode, the contrary is
|
||||
-- not necessary.
|
||||
--
|
||||
---C++: inline
|
||||
|
||||
|
||||
end OrientedShapeMapHasher;
|
7
src/TopTools/TopTools_OrientedShapeMapHasher.cxx
Executable file
7
src/TopTools/TopTools_OrientedShapeMapHasher.cxx
Executable file
@@ -0,0 +1,7 @@
|
||||
// File: TopTools_OrientedShapeMapHasher.cxx
|
||||
// Created: Thu Jan 14 16:01:29 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopTools_OrientedShapeMapHasher.ixx>
|
27
src/TopTools/TopTools_OrientedShapeMapHasher.lxx
Executable file
27
src/TopTools/TopTools_OrientedShapeMapHasher.lxx
Executable file
@@ -0,0 +1,27 @@
|
||||
// File: TopTools_OrientedShapeMapHasher.lxx
|
||||
// Created: Thu Jan 14 16:01:40 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : HashCode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer TopTools_OrientedShapeMapHasher::HashCode
|
||||
(const TopoDS_Shape& S, const Standard_Integer Upper)
|
||||
{
|
||||
return S.HashCode(Upper);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean TopTools_OrientedShapeMapHasher::IsEqual
|
||||
(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
|
||||
{
|
||||
return S1.IsEqual(S2);
|
||||
}
|
29
src/TopTools/TopTools_ShapeMapHasher.cdl
Executable file
29
src/TopTools/TopTools_ShapeMapHasher.cdl
Executable file
@@ -0,0 +1,29 @@
|
||||
-- File: TopTools_ShapeMapHasher.cdl
|
||||
-- Created: Thu Jan 14 14:35:23 1993
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ShapeMapHasher from TopTools
|
||||
---Purpose: Hash tool, used for generating maps of shapes in topology.
|
||||
uses
|
||||
Shape from TopoDS
|
||||
|
||||
is
|
||||
|
||||
HashCode(myclass; S : Shape from TopoDS; Upper : Integer) returns Integer;
|
||||
---Purpose: Returns a HasCode value for the Key <K> in the
|
||||
-- range 0..Upper.
|
||||
--
|
||||
---C++: inline
|
||||
|
||||
IsEqual(myclass; S1, S2 : Shape from TopoDS) returns Boolean;
|
||||
---Purpose: Returns True when the two keys are the same. Two
|
||||
-- same keys must have the same hashcode, the
|
||||
-- contrary is not necessary.
|
||||
--
|
||||
---C++: inline
|
||||
|
||||
|
||||
end ShapeMapHasher;
|
7
src/TopTools/TopTools_ShapeMapHasher.cxx
Executable file
7
src/TopTools/TopTools_ShapeMapHasher.cxx
Executable file
@@ -0,0 +1,7 @@
|
||||
// File: TopTools_ShapeMapHasher.cxx
|
||||
// Created: Thu Jan 14 16:01:29 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopTools_ShapeMapHasher.ixx>
|
27
src/TopTools/TopTools_ShapeMapHasher.lxx
Executable file
27
src/TopTools/TopTools_ShapeMapHasher.lxx
Executable file
@@ -0,0 +1,27 @@
|
||||
// File: TopTools_ShapeMapHasher.lxx
|
||||
// Created: Thu Jan 14 16:01:40 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : HashCode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer TopTools_ShapeMapHasher::HashCode
|
||||
(const TopoDS_Shape& S, const Standard_Integer Upper)
|
||||
{
|
||||
return S.HashCode(Upper);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean TopTools_ShapeMapHasher::IsEqual
|
||||
(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
|
||||
{
|
||||
return S1.IsSame(S2);
|
||||
}
|
219
src/TopTools/TopTools_ShapeSet.cdl
Executable file
219
src/TopTools/TopTools_ShapeSet.cdl
Executable file
@@ -0,0 +1,219 @@
|
||||
-- File: TopTools_ShapeSet.cdl
|
||||
-- Created: Thu Jul 1 17:13:36 1993
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
--
|
||||
class ShapeSet from TopTools
|
||||
|
||||
---Purpose: A ShapeSets contains a Shape and all its
|
||||
-- sub-shapes and locations. It can be dump, write
|
||||
-- and read.
|
||||
--
|
||||
-- Methods to handle the geometry can be redefined.
|
||||
--
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
IndexedMapOfShape from TopTools,
|
||||
LocationSet from TopTools,
|
||||
ShapeEnum from TopAbs,
|
||||
AsciiString from TCollection,
|
||||
ProgressIndicator from Message
|
||||
|
||||
is
|
||||
|
||||
Create returns ShapeSet from TopTools;
|
||||
---Purpose: Builds an empty ShapeSet.
|
||||
|
||||
Delete(me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~TopTools_ShapeSet(){Delete() ; }"
|
||||
|
||||
SetFormatNb(me : out; theFormatNb : Integer) is static;
|
||||
FormatNb(me) returns Integer is static;
|
||||
---Purpose: two formats available for the moment:
|
||||
-- First: does not write CurveOnSurface UV Points into the file
|
||||
-- on reading calls Check() method.
|
||||
-- Second: stores CurveOnSurface UV Points.
|
||||
-- On reading format is recognized from Version string.
|
||||
|
||||
Clear(me : in out)
|
||||
---Purpose: Clears the content of the set. This method can be
|
||||
-- redefined.
|
||||
is virtual;
|
||||
|
||||
Add(me : in out; S : Shape from TopoDS) returns Integer
|
||||
---Purpose: Stores <S> and its sub-shape. Returns the index of <S>.
|
||||
-- The method AddGeometry is called on each sub-shape.
|
||||
is static;
|
||||
|
||||
Shape(me; I : Integer) returns Shape from TopoDS
|
||||
---Purpose: Returns the sub-shape of index <I>.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
Index(me; S : Shape from TopoDS) returns Integer
|
||||
---Purpose: Returns the index of <S>.
|
||||
is static;
|
||||
|
||||
Locations(me) returns LocationSet from TopTools
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
ChangeLocations(me : in out) returns LocationSet from TopTools
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
DumpExtent(me; OS : in out OStream) returns OStream
|
||||
---Purpose: Dumps the number of objects in me on the stream <OS>.
|
||||
-- (Number of shapes of each type)
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
DumpExtent(me; S : in out AsciiString from TCollection)
|
||||
---Purpose: Dumps the number of objects in me in the string S
|
||||
-- (Number of shapes of each type)
|
||||
is static;
|
||||
|
||||
|
||||
Dump(me; OS : in out OStream)
|
||||
---Purpose: Dumps the content of me on the stream <OS>.
|
||||
--
|
||||
-- Dumps the shapes from first to last.
|
||||
-- For each Shape
|
||||
-- Dump the type, the flags, the subshapes
|
||||
-- calls DumpGeometry(S)
|
||||
--
|
||||
--
|
||||
-- Dumps the geometry calling DumpGeometry.
|
||||
--
|
||||
-- Dumps the locations.
|
||||
is virtual;
|
||||
|
||||
Write(me: in out; OS : in out OStream)
|
||||
---Purpose: Writes the content of me on the stream <OS> in a
|
||||
-- format that can be read back by Read.
|
||||
--
|
||||
-- Writes the locations.
|
||||
--
|
||||
-- Writes the geometry calling WriteGeometry.
|
||||
--
|
||||
-- Dumps the shapes from last to first.
|
||||
-- For each shape :
|
||||
-- Write the type.
|
||||
-- calls WriteGeometry(S).
|
||||
-- Write the flags, the subshapes.
|
||||
is virtual;
|
||||
|
||||
Read(me : in out; IS : in out IStream)
|
||||
---Purpose: Reads the content of me from the stream <IS>. me
|
||||
-- is first cleared.
|
||||
--
|
||||
-- Reads the locations.
|
||||
--
|
||||
-- Reads the geometry calling ReadGeometry.
|
||||
--
|
||||
-- Reads the shapes.
|
||||
-- For each shape
|
||||
-- Reads the type.
|
||||
-- calls ReadGeometry(T,S).
|
||||
-- Reads the flag, the subshapes.
|
||||
is virtual;
|
||||
|
||||
Dump(me; S : Shape from TopoDS; OS : in out OStream)
|
||||
---Purpose: Dumps on <OS> the shape <S>. Dumps the
|
||||
-- orientation, the index of the TShape and the index
|
||||
-- of the Location.
|
||||
is static;
|
||||
|
||||
Write(me; S : Shape from TopoDS; OS : in out OStream)
|
||||
---Purpose: Writes on <OS> the shape <S>. Writes the
|
||||
-- orientation, the index of the TShape and the index
|
||||
-- of the Location.
|
||||
is static;
|
||||
|
||||
Read(me; S : in out Shape from TopoDS; IS : in out IStream)
|
||||
---Purpose: Reads from <IS> a shape and returns it in S.
|
||||
is static;
|
||||
|
||||
Read(me; S : in out Shape from TopoDS; IS : in out IStream;
|
||||
NbShapes : Integer)
|
||||
---Purpose: Reads from <IS> a shape and returns it in S.
|
||||
-- <NbShapes> is the number of tshapes in the set.
|
||||
is static private;
|
||||
|
||||
--
|
||||
-- Auxliary methods for the geometry. They can be redefined. In
|
||||
-- this class the perform nothing.
|
||||
--
|
||||
|
||||
AddGeometry(me : in out; S : Shape from TopoDS)
|
||||
---Purpose: Stores the geometry of <S>.
|
||||
is virtual;
|
||||
|
||||
DumpGeometry(me; OS : in out OStream)
|
||||
---Purpose: Dumps the geometry of me on the stream <OS>.
|
||||
is virtual;
|
||||
|
||||
WriteGeometry(me : in out; OS : in out OStream)
|
||||
---Purpose: Writes the geometry of me on the stream <OS> in a
|
||||
-- format that can be read back by Read.
|
||||
is virtual;
|
||||
|
||||
ReadGeometry(me : in out; IS : in out IStream)
|
||||
---Purpose: Reads the geometry of me from the stream <IS>.
|
||||
is virtual;
|
||||
|
||||
DumpGeometry(me; S : Shape from TopoDS; OS : in out OStream)
|
||||
---Purpose: Dumps the geometry of <S> on the stream <OS>.
|
||||
is virtual;
|
||||
|
||||
WriteGeometry(me; S : Shape from TopoDS; OS : in out OStream)
|
||||
---Purpose: Writes the geometry of <S> on the stream <OS> in a
|
||||
-- format that can be read back by Read.
|
||||
is virtual;
|
||||
|
||||
ReadGeometry(me : in out; T : ShapeEnum from TopAbs;
|
||||
IS : in out IStream;
|
||||
S : out Shape from TopoDS)
|
||||
---Purpose: Reads the geometry of a shape of type <T> from the
|
||||
-- stream <IS> and returns it in <S>.
|
||||
is virtual;
|
||||
|
||||
|
||||
AddShapes(me : in out; S1 : in out Shape from TopoDS;
|
||||
S2 : Shape from TopoDS)
|
||||
---Purpose: Inserts the shape <S2> in the shape <S1>. This
|
||||
-- method must be redefined to use the correct
|
||||
-- builder.
|
||||
is virtual;
|
||||
|
||||
|
||||
Check(me : in out; T : ShapeEnum from TopAbs;
|
||||
S : in out Shape from TopoDS)
|
||||
---Purpose: This method is called after each new completed
|
||||
-- shape. <T> is the type. <S> is the shape. In this
|
||||
-- class it does nothing, but it gives the opportunity
|
||||
-- in derived classes to perform extra treatment on
|
||||
-- shapes.
|
||||
is virtual;
|
||||
|
||||
NbShapes(me) returns Integer;
|
||||
---Purpose:Returns number of shapes read from file.
|
||||
|
||||
SetProgress(me : in out; PR : ProgressIndicator from Message);
|
||||
|
||||
GetProgress(me) returns ProgressIndicator from Message;
|
||||
|
||||
fields
|
||||
myShapes : IndexedMapOfShape from TopTools;
|
||||
myLocations : LocationSet from TopTools;
|
||||
myFormatNb : Integer from Standard; -- jfa 26.09.2001
|
||||
myProgress : ProgressIndicator from Message;
|
||||
|
||||
end ShapeSet;
|
||||
|
||||
|
974
src/TopTools/TopTools_ShapeSet.cxx
Executable file
974
src/TopTools/TopTools_ShapeSet.cxx
Executable file
@@ -0,0 +1,974 @@
|
||||
// File: TopTools_ShapeSet.cxx
|
||||
// Created: Fri Jul 2 13:03:52 1993
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
// Modified: 02 Nov 2000: BUC60769. JMB, PTV. In order to be able to read BRep
|
||||
// files that came from a platform different from where CasCade
|
||||
// is run, we need the following modifications.
|
||||
//
|
||||
// On Unix platforms:
|
||||
// ------------------
|
||||
// In method Read(Standard_IStream &IS), during the version
|
||||
// authentification we cut last '\r' in the line (which will
|
||||
// be present if file is in DOS coding)
|
||||
|
||||
#include <TopTools_ShapeSet.ixx>
|
||||
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
|
||||
const char* Version = "CASCADE Topology V1, (c) Matra-Datavision";
|
||||
const char* Version2 = "CASCADE Topology V2, (c) Matra-Datavision";
|
||||
|
||||
//=======================================================================
|
||||
//function : TopTools_ShapeSet
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopTools_ShapeSet::TopTools_ShapeSet() : myFormatNb(1)
|
||||
{
|
||||
}
|
||||
|
||||
void TopTools_ShapeSet::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFormatNb
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TopTools_ShapeSet::SetFormatNb(const Standard_Integer theFormatNb)
|
||||
{
|
||||
myFormatNb = theFormatNb;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FormatNb
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TopTools_ShapeSet::FormatNb() const
|
||||
{
|
||||
return myFormatNb;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Clear()
|
||||
{
|
||||
myShapes.Clear();
|
||||
myLocations.Clear();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TopTools_ShapeSet::Add(const TopoDS_Shape& S)
|
||||
{
|
||||
if (S.IsNull()) return 0;
|
||||
myLocations.Add(S.Location());
|
||||
TopoDS_Shape S2 = S;
|
||||
S2.Location(TopLoc_Location());
|
||||
Standard_Integer index = myShapes.FindIndex(S2);
|
||||
if (index == 0) {
|
||||
AddGeometry(S2);
|
||||
|
||||
for (TopoDS_Iterator its(S2,Standard_False,Standard_False);
|
||||
its.More(); its.Next())
|
||||
Add(its.Value());
|
||||
index = myShapes.Add(S2);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopoDS_Shape& TopTools_ShapeSet::Shape(const Standard_Integer I)const
|
||||
{
|
||||
return myShapes(I);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Index
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TopTools_ShapeSet::Index(const TopoDS_Shape& S) const
|
||||
{
|
||||
return myShapes.FindIndex(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Locations
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopTools_LocationSet& TopTools_ShapeSet::Locations()const
|
||||
{
|
||||
return myLocations;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeLocations
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopTools_LocationSet& TopTools_ShapeSet::ChangeLocations()
|
||||
{
|
||||
return myLocations;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PrintShapeEnum
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void PrintShapeEnum(const TopAbs_ShapeEnum T,
|
||||
Standard_OStream& S,
|
||||
Standard_Boolean C)
|
||||
{
|
||||
switch(T) {
|
||||
|
||||
case TopAbs_VERTEX :
|
||||
if (C) S << "Ve"; else S << "VERTEX ";
|
||||
break;
|
||||
|
||||
case TopAbs_EDGE :
|
||||
if (C) S << "Ed"; else S << "EDGE ";
|
||||
break;
|
||||
|
||||
case TopAbs_WIRE :
|
||||
if (C) S << "Wi"; else S << "WIRE ";
|
||||
break;
|
||||
|
||||
case TopAbs_FACE :
|
||||
if (C) S << "Fa"; else S << "FACE ";
|
||||
break;
|
||||
|
||||
case TopAbs_SHELL :
|
||||
if (C) S << "Sh"; else S << "SHELL ";
|
||||
break;
|
||||
|
||||
case TopAbs_SOLID :
|
||||
if (C) S << "So"; else S << "SOLID ";
|
||||
break;
|
||||
|
||||
case TopAbs_COMPSOLID :
|
||||
if (C) S << "CS"; else S << "COMPSOLID";
|
||||
break;
|
||||
|
||||
case TopAbs_COMPOUND :
|
||||
if (C) S << "Co"; else S << "COMPOUND ";
|
||||
break;
|
||||
|
||||
case TopAbs_SHAPE :
|
||||
if (C) S << "Sp"; else S << "SHAPE";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PrintOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void PrintOrientation(const TopAbs_Orientation O,
|
||||
Standard_OStream& S,
|
||||
Standard_Boolean C)
|
||||
{
|
||||
switch(O) {
|
||||
|
||||
case TopAbs_FORWARD :
|
||||
if (C) S << "+"; else S << "FORWARD";
|
||||
break;
|
||||
|
||||
case TopAbs_REVERSED :
|
||||
if (C) S << "-"; else S << "REVERSED";
|
||||
break;
|
||||
|
||||
case TopAbs_INTERNAL :
|
||||
if (C) S << "i"; else S << "INTERNAL";
|
||||
break;
|
||||
|
||||
case TopAbs_EXTERNAL :
|
||||
if (C) S << "e"; else S << "EXTERNAL";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpExtent
|
||||
//purpose : Dump number of shapes.
|
||||
//=======================================================================
|
||||
|
||||
Standard_OStream& TopTools_ShapeSet::DumpExtent(Standard_OStream& OS)const
|
||||
{
|
||||
|
||||
Standard_Integer nbVERTEX = 0;
|
||||
Standard_Integer nbEDGE = 0;
|
||||
Standard_Integer nbWIRE = 0;
|
||||
Standard_Integer nbFACE = 0;
|
||||
Standard_Integer nbSHELL = 0;
|
||||
Standard_Integer nbSOLID = 0;
|
||||
Standard_Integer nbCOMPSOLID = 0;
|
||||
Standard_Integer nbCOMPOUND = 0;
|
||||
Standard_Integer nbSHAPE = myShapes.Extent();
|
||||
|
||||
for (Standard_Integer i = 1; i <= nbSHAPE; i++) {
|
||||
|
||||
switch(myShapes(i).ShapeType()) {
|
||||
|
||||
case TopAbs_VERTEX :
|
||||
nbVERTEX++;
|
||||
break;
|
||||
|
||||
case TopAbs_EDGE :
|
||||
nbEDGE++;
|
||||
break;
|
||||
|
||||
case TopAbs_WIRE :
|
||||
nbWIRE++;
|
||||
break;
|
||||
|
||||
case TopAbs_FACE :
|
||||
nbFACE++;
|
||||
break;
|
||||
|
||||
case TopAbs_SHELL :
|
||||
nbSHELL++;
|
||||
break;
|
||||
|
||||
case TopAbs_SOLID :
|
||||
nbSOLID++;
|
||||
break;
|
||||
|
||||
case TopAbs_COMPSOLID :
|
||||
nbCOMPSOLID++;
|
||||
break;
|
||||
|
||||
case TopAbs_COMPOUND :
|
||||
nbCOMPOUND++;
|
||||
break;
|
||||
|
||||
case TopAbs_SHAPE :
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OS << " VERTEX : " << nbVERTEX << "\n";
|
||||
OS << " EDGE : " << nbEDGE << "\n";
|
||||
OS << " WIRE : " << nbWIRE << "\n";
|
||||
OS << " FACE : " << nbFACE << "\n";
|
||||
OS << " SHELL : " << nbSHELL << "\n";
|
||||
OS << " SOLID : " << nbSOLID << "\n";
|
||||
OS << " COMPSOLID : " << nbCOMPSOLID << "\n";
|
||||
OS << " COMPOUND : " << nbCOMPOUND << "\n";
|
||||
OS << " SHAPE : " << nbSHAPE << "\n";
|
||||
|
||||
return OS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpExtent
|
||||
//purpose : Dump number of shapes.
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::DumpExtent(TCollection_AsciiString& S)const
|
||||
{
|
||||
|
||||
Standard_Integer nbVERTEX = 0;
|
||||
Standard_Integer nbEDGE = 0;
|
||||
Standard_Integer nbWIRE = 0;
|
||||
Standard_Integer nbFACE = 0;
|
||||
Standard_Integer nbSHELL = 0;
|
||||
Standard_Integer nbSOLID = 0;
|
||||
Standard_Integer nbCOMPSOLID = 0;
|
||||
Standard_Integer nbCOMPOUND = 0;
|
||||
Standard_Integer nbSHAPE = myShapes.Extent();
|
||||
|
||||
for (Standard_Integer i = 1; i <= nbSHAPE; i++) {
|
||||
|
||||
switch(myShapes(i).ShapeType()) {
|
||||
|
||||
case TopAbs_VERTEX :
|
||||
nbVERTEX++;
|
||||
break;
|
||||
|
||||
case TopAbs_EDGE :
|
||||
nbEDGE++;
|
||||
break;
|
||||
|
||||
case TopAbs_WIRE :
|
||||
nbWIRE++;
|
||||
break;
|
||||
|
||||
case TopAbs_FACE :
|
||||
nbFACE++;
|
||||
break;
|
||||
|
||||
case TopAbs_SHELL :
|
||||
nbSHELL++;
|
||||
break;
|
||||
|
||||
case TopAbs_SOLID :
|
||||
nbSOLID++;
|
||||
break;
|
||||
|
||||
case TopAbs_COMPSOLID :
|
||||
nbCOMPSOLID++;
|
||||
break;
|
||||
|
||||
case TopAbs_COMPOUND :
|
||||
nbCOMPOUND++;
|
||||
break;
|
||||
|
||||
case TopAbs_SHAPE :
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
S = S + " VERTEX : " + TCollection_AsciiString(nbVERTEX) + "\n";
|
||||
S = S + " EDGE : " + TCollection_AsciiString(nbEDGE) + "\n";
|
||||
S = S + " WIRE : " + TCollection_AsciiString(nbWIRE) + "\n";
|
||||
S = S + " FACE : " + TCollection_AsciiString(nbFACE) + "\n";
|
||||
S = S + " SHELL : " + TCollection_AsciiString(nbSHELL) + "\n";
|
||||
S = S + " SOLID : " + TCollection_AsciiString(nbSOLID) + "\n";
|
||||
S = S + " COMPSOLID : " + TCollection_AsciiString(nbCOMPSOLID) + "\n";
|
||||
S = S + " COMPOUND : " + TCollection_AsciiString(nbCOMPOUND) + "\n";
|
||||
S = S + " SHAPE : " + TCollection_AsciiString(nbSHAPE) + "\n";
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Dump(Standard_OStream& OS)const
|
||||
{
|
||||
//-----------------------------------------
|
||||
// dump the shapes
|
||||
//-----------------------------------------
|
||||
|
||||
Standard_Integer i, nbShapes = myShapes.Extent();
|
||||
|
||||
OS << "\nDump of " << nbShapes << " TShapes";
|
||||
OS << "\n\n-----------------\n\n";
|
||||
|
||||
OS << "Flags : Free, Modified, Checked, Orientable, Closed, Infinite, Convex";
|
||||
OS << "\n\n";
|
||||
|
||||
for (i = nbShapes; i >= 1; i--) {
|
||||
|
||||
const TopoDS_Shape& S = myShapes(i);
|
||||
OS << "TShape # " << nbShapes - i + 1 << " : ";
|
||||
|
||||
// Type and flags
|
||||
|
||||
PrintShapeEnum(S.ShapeType(),OS,Standard_False);
|
||||
OS << " ";
|
||||
OS << (S.Free() ? 1 : 0);
|
||||
OS << (S.Modified() ? 1 : 0);
|
||||
OS << (S.Checked() ? 1 : 0);
|
||||
OS << (S.Orientable() ? 1 : 0);
|
||||
OS << (S.Closed() ? 1 : 0);
|
||||
OS << (S.Infinite() ? 1 : 0);
|
||||
OS << (S.Convex() ? 1 : 0);
|
||||
OS << " " << (void*) &(*S.TShape()) <<"\n";
|
||||
|
||||
// sub-shapes
|
||||
OS << " ";
|
||||
TopoDS_Iterator its(S,Standard_False,Standard_False);
|
||||
while (its.More()) {
|
||||
const TopoDS_Shape& sub = its.Value();
|
||||
PrintOrientation(sub.Orientation(),OS,Standard_True);
|
||||
OS<<nbShapes - myShapes.FindIndex(sub.Located(TopLoc_Location())) + 1;
|
||||
if (!sub.Location().IsIdentity())
|
||||
OS << "(L" << myLocations.Index(sub.Location()) << ")";
|
||||
OS << " ";
|
||||
its.Next();
|
||||
}
|
||||
OS << "\n";
|
||||
|
||||
// Geometry
|
||||
|
||||
DumpGeometry(S,OS);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// dump the geometry
|
||||
//-----------------------------------------
|
||||
|
||||
DumpGeometry(OS);
|
||||
|
||||
//-----------------------------------------
|
||||
// dump the locations
|
||||
//-----------------------------------------
|
||||
|
||||
myLocations.Dump(OS);
|
||||
|
||||
OS << endl;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Write(Standard_OStream& OS)
|
||||
{
|
||||
|
||||
// on sauvegarde l'ancien LC_NUMERIC
|
||||
char *oldnum,*plocal ;
|
||||
plocal = setlocale(LC_NUMERIC, NULL) ;
|
||||
oldnum = new char[strlen(plocal)+1] ;
|
||||
strcpy(oldnum,plocal);
|
||||
|
||||
// on positionne LC_NUMERIC a "C" (point decimal)
|
||||
setlocale(LC_NUMERIC, "C") ;
|
||||
|
||||
int prec = OS.precision(15);
|
||||
|
||||
// write the copyright
|
||||
if (myFormatNb == 2)
|
||||
OS << "\n" << Version2 << endl;
|
||||
else
|
||||
OS << "\n" << Version << endl;
|
||||
|
||||
//-----------------------------------------
|
||||
// write the locations
|
||||
//-----------------------------------------
|
||||
|
||||
if (!myProgress.IsNull() && myProgress->UserBreak()) {
|
||||
cout << "Interrupted by the user"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 10, "Locations" );
|
||||
myLocations.SetProgress(myProgress);
|
||||
myLocations.Write(OS);
|
||||
if ( !myProgress.IsNull() ) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
|
||||
|
||||
if (!myProgress.IsNull() && myProgress->UserBreak()) {
|
||||
cout << "Interrupted by the user"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// write the geometry
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 75, "Geometry" );
|
||||
WriteGeometry(OS);
|
||||
if ( !myProgress.IsNull() ) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// write the shapes
|
||||
//-----------------------------------------
|
||||
|
||||
Standard_Integer i, nbShapes = myShapes.Extent();
|
||||
|
||||
OS << "\nTShapes " << nbShapes << "\n";
|
||||
|
||||
|
||||
// subshapes are written first
|
||||
//OCC19559
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 15, "Shapes" );
|
||||
Message_ProgressSentry PS(myProgress, "Shapes", 0, nbShapes, 1);
|
||||
|
||||
for (i = 1; i <= nbShapes && PS.More(); i++, PS.Next()) {
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->Show();
|
||||
|
||||
const TopoDS_Shape& S = myShapes(i);
|
||||
|
||||
// Type
|
||||
PrintShapeEnum(S.ShapeType(),OS,Standard_True);
|
||||
OS << "\n";
|
||||
|
||||
// Geometry
|
||||
WriteGeometry(S,OS);
|
||||
|
||||
// Flags
|
||||
OS << "\n";
|
||||
OS << (S.Free() ? 1 : 0);
|
||||
OS << (S.Modified() ? 1 : 0);
|
||||
OS << (S.Checked() ? 1 : 0);
|
||||
OS << (S.Orientable() ? 1 : 0);
|
||||
OS << (S.Closed() ? 1 : 0);
|
||||
OS << (S.Infinite() ? 1 : 0);
|
||||
OS << (S.Convex() ? 1 : 0);
|
||||
OS << "\n";
|
||||
|
||||
// sub-shapes
|
||||
|
||||
Standard_Integer l = 0;
|
||||
TopoDS_Iterator its(S,Standard_False,Standard_False);
|
||||
while (its.More()) {
|
||||
Write(its.Value(),OS);
|
||||
l++;
|
||||
if (l == 10) {
|
||||
OS << "\n";
|
||||
l = 0;
|
||||
}
|
||||
its.Next();
|
||||
}
|
||||
Write(TopoDS_Shape(),OS); // Null shape to end the list
|
||||
OS << "\n";
|
||||
}
|
||||
|
||||
OS << endl;
|
||||
OS.precision(prec);
|
||||
PS.Relieve();
|
||||
if (!myProgress.IsNull()) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadShapeEnum
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static TopAbs_ShapeEnum ReadShapeEnum(Standard_IStream& IS)
|
||||
{
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
|
||||
switch (buffer[0]) {
|
||||
|
||||
case 'V' :
|
||||
return TopAbs_VERTEX;
|
||||
|
||||
case 'E' :
|
||||
return TopAbs_EDGE;
|
||||
|
||||
case 'W' :
|
||||
return TopAbs_WIRE;
|
||||
|
||||
case 'F' :
|
||||
return TopAbs_FACE;
|
||||
|
||||
case 'S' :
|
||||
if (buffer[1] == 'h')
|
||||
return TopAbs_SHELL;
|
||||
else
|
||||
return TopAbs_SOLID;
|
||||
|
||||
case 'C' :
|
||||
if (buffer[1] == 'S')
|
||||
return TopAbs_COMPSOLID;
|
||||
else
|
||||
return TopAbs_COMPOUND;
|
||||
|
||||
}
|
||||
return TopAbs_COMPOUND;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Read(Standard_IStream& IS)
|
||||
{
|
||||
// on sauvegarde l'ancien LC_NUMERIC
|
||||
char *oldnum,*plocal ;
|
||||
plocal = setlocale(LC_NUMERIC, NULL) ;
|
||||
oldnum = new char[strlen(plocal)+1] ;
|
||||
strcpy(oldnum,plocal);
|
||||
|
||||
Clear();
|
||||
|
||||
// Check the version
|
||||
char vers[101];
|
||||
do {
|
||||
IS.getline(vers,100,'\n');
|
||||
// BUC60769 PTV 18.10.2000: remove possible '\r' at the end of the line
|
||||
//Standard_Integer lv = strlen(vers);
|
||||
//char *pm;
|
||||
//if(pm = strchr(vers,'\r'))
|
||||
// *pm ='\0';
|
||||
|
||||
for (Standard_Integer lv = (strlen(vers)- 1); lv > 1 && (vers[lv] == '\r' || vers[lv] == '\n') ;lv--)
|
||||
vers[lv] = '\0';
|
||||
|
||||
} while ( ! IS.fail() && strcmp(vers,Version) && strcmp(vers,Version2) );
|
||||
if (IS.fail()) {
|
||||
cout << "File was not written with this version of the topology"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
if (strcmp(vers,Version2) == 0) SetFormatNb(2);
|
||||
else SetFormatNb(1);
|
||||
|
||||
//-----------------------------------------
|
||||
// read the locations
|
||||
//-----------------------------------------
|
||||
|
||||
//OCC19559
|
||||
if (!myProgress.IsNull() && myProgress->UserBreak()) {
|
||||
cout << "Interrupted by the user"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 10, "Locations" );
|
||||
myLocations.SetProgress(myProgress);
|
||||
myLocations.Read(IS);
|
||||
if ( !myProgress.IsNull() ) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
//OCC19559
|
||||
if (!myProgress.IsNull() && myProgress->UserBreak()) {
|
||||
cout << "Interrupted by the user"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// read the geometry
|
||||
//-----------------------------------------
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 75, "Geometry" );
|
||||
ReadGeometry(IS);
|
||||
if ( !myProgress.IsNull() ) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// read the shapes
|
||||
//-----------------------------------------
|
||||
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
if (strcmp(buffer,"TShapes")) {
|
||||
cout << "Not a TShape table"<<endl;
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Integer i, nbShapes;
|
||||
IS >> nbShapes;
|
||||
|
||||
//OCC19559
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->NewScope ( 15, "Shapes" );
|
||||
Message_ProgressSentry PS(myProgress, "Shapes", 0, nbShapes, 1);
|
||||
for (i = 1; i <= nbShapes && PS.More(); i++, PS.Next() ) {
|
||||
if ( !myProgress.IsNull() )
|
||||
myProgress->Show();
|
||||
TopoDS_Shape S;
|
||||
|
||||
//Read type and create empty shape.
|
||||
|
||||
TopAbs_ShapeEnum T = ReadShapeEnum(IS);
|
||||
ReadGeometry(T,IS,S);
|
||||
|
||||
// Set the flags
|
||||
IS >> buffer;
|
||||
|
||||
// sub-shapes
|
||||
TopoDS_Shape SS;
|
||||
do {
|
||||
Read(SS,IS,nbShapes);
|
||||
if (!SS.IsNull())
|
||||
AddShapes(S,SS);
|
||||
} while(!SS.IsNull());
|
||||
|
||||
S.Free (buffer[0] == '1');
|
||||
S.Modified (buffer[1] == '1');
|
||||
|
||||
if (myFormatNb == 2)
|
||||
S.Checked (buffer[2] == '1');
|
||||
else
|
||||
S.Checked (Standard_False); // force check at reading..
|
||||
|
||||
S.Orientable(buffer[3] == '1');
|
||||
S.Closed (buffer[4] == '1');
|
||||
S.Infinite (buffer[5] == '1');
|
||||
S.Convex (buffer[6] == '1');
|
||||
|
||||
// check
|
||||
|
||||
if (myFormatNb == 1)
|
||||
Check(T,S);
|
||||
|
||||
myShapes.Add(S);
|
||||
}
|
||||
if (!myProgress.IsNull()) {
|
||||
myProgress->EndScope();
|
||||
myProgress->Show();
|
||||
}
|
||||
|
||||
// on remet le LC_NUMERIC a la precedente valeur
|
||||
setlocale(LC_NUMERIC, oldnum) ;
|
||||
delete[] oldnum;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Dump(const TopoDS_Shape& S,
|
||||
Standard_OStream& OS)const
|
||||
{
|
||||
if (S.IsNull()) OS << "Null shape\n";
|
||||
OS << "Shape : " << myShapes.FindIndex(S.Located(TopLoc_Location()));
|
||||
OS << ", ";
|
||||
PrintOrientation(S.Orientation(),OS,Standard_False);
|
||||
if (!S.Location().IsIdentity())
|
||||
OS <<", location : " << myLocations.Index(S.Location());
|
||||
OS << "\n";
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Write(const TopoDS_Shape& S,
|
||||
Standard_OStream& OS)const
|
||||
{
|
||||
if (S.IsNull()) OS << "*";
|
||||
else {
|
||||
PrintOrientation(S.Orientation(),OS,Standard_True);
|
||||
OS << myShapes.Extent() - myShapes.FindIndex(S.Located(TopLoc_Location())) + 1;
|
||||
OS << " " << myLocations.Index(S.Location()) << " ";
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Read(TopoDS_Shape& S,
|
||||
Standard_IStream& IS)const
|
||||
{
|
||||
Read(S,IS,myShapes.Extent());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Read(TopoDS_Shape& S,
|
||||
Standard_IStream& IS,
|
||||
const Standard_Integer nbshapes)const
|
||||
{
|
||||
if(nbshapes < 1)
|
||||
{
|
||||
S = TopoDS_Shape();
|
||||
return;
|
||||
}
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
if (buffer[0] == '*')
|
||||
S = TopoDS_Shape();
|
||||
else {
|
||||
S = myShapes(nbshapes - atoi(buffer+1) + 1);
|
||||
switch (buffer[0]) {
|
||||
|
||||
case '+' :
|
||||
S.Orientation(TopAbs_FORWARD);
|
||||
break;
|
||||
|
||||
case '-' :
|
||||
S.Orientation(TopAbs_REVERSED);
|
||||
break;
|
||||
|
||||
case 'i' :
|
||||
S.Orientation(TopAbs_INTERNAL);
|
||||
break;
|
||||
|
||||
case 'e' :
|
||||
S.Orientation(TopAbs_EXTERNAL);
|
||||
break;
|
||||
}
|
||||
|
||||
Standard_Integer l;
|
||||
IS >> l;
|
||||
S.Location(myLocations.Location(l));
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::AddGeometry(const TopoDS_Shape&)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::DumpGeometry(Standard_OStream&) const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::WriteGeometry(Standard_OStream&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::ReadGeometry(Standard_IStream&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::DumpGeometry(const TopoDS_Shape&,
|
||||
Standard_OStream&)const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::WriteGeometry(const TopoDS_Shape&,
|
||||
Standard_OStream&)const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum,
|
||||
Standard_IStream& ,
|
||||
TopoDS_Shape&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AddShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::AddShapes(TopoDS_Shape&,
|
||||
const TopoDS_Shape&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Check
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::Check(const TopAbs_ShapeEnum,
|
||||
TopoDS_Shape&)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TopTools_ShapeSet::NbShapes() const
|
||||
{
|
||||
return myShapes.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Message_ProgressIndicator) TopTools_ShapeSet::GetProgress() const
|
||||
{
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopTools_ShapeSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
|
||||
{
|
||||
myProgress = PR;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user