mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fa04444ba3 | ||
|
983e35ed71 | ||
|
74095a8b46 | ||
|
576f376108 | ||
|
447396c9b9 | ||
|
9d93d9b9b8 | ||
|
d5bcd33386 | ||
|
3888b58c27 | ||
|
d1eae5b0d0 | ||
|
32f7b4e5bf | ||
|
993da38d54 | ||
|
a9becad233 | ||
|
5939991070 | ||
|
e8a36f3a02 | ||
|
f286953d85 | ||
|
20955d88da | ||
|
80705eaf31 | ||
|
7b9bda716e | ||
|
dec56592dd | ||
|
f035e0718b | ||
|
cb290cc932 | ||
|
cdc6566c3c | ||
|
631a34a05f | ||
|
0141024df5 | ||
|
5c94806385 | ||
|
f0caf64f54 |
@@ -475,7 +475,7 @@ Modify this parameter with:
|
||||
if(!Interface_Static::SetIVal("read.step.tessellated",1))
|
||||
.. error ..
|
||||
~~~~
|
||||
Default value is 0 (On).
|
||||
Default value is 1 (On).
|
||||
|
||||
@subsubsection occt_step_2_3_4 Performing the STEP file translation
|
||||
|
||||
@@ -1653,6 +1653,13 @@ For each Saved View OCCT STEP Reader will retrieve the following attributes:
|
||||
- clipping planes (single plane of combination of planes);
|
||||
- front and back plane clipping.
|
||||
|
||||
### User defined attributes
|
||||
Attributes are implemented in accordance with <a href="https://www.mbx-if.org/documents/rec_prac_user_def_attributes_v18.pdf">Recommended practices for User Defined Attributes</a> section 4, 5, 6.1-6.3 and 7.
|
||||
Attributes can be read for shapes at levels:
|
||||
- Part/Product Level;
|
||||
- Component Instances in an Assembly;
|
||||
- Geometry Level.
|
||||
|
||||
@subsection occt_step_7_3 Writing to STEP
|
||||
|
||||
The translation from XDE to STEP can be initialized as follows:
|
||||
@@ -1730,5 +1737,8 @@ Interface_Static::SetIVal("write.step.schema", 5));
|
||||
### Saved views
|
||||
Saved Views are not exported by OCCT.
|
||||
|
||||
### User defined attributes
|
||||
Attributes can be imported from STEP.
|
||||
|
||||
|
||||
|
||||
|
@@ -92,7 +92,7 @@ void BOPTest::ReportAlerts(const Handle(Message_Report)& theReport)
|
||||
for (int iGravity = 0; iGravity < 2; iGravity++)
|
||||
{
|
||||
// report shapes for the same type of alert together
|
||||
NCollection_Map<Handle(Standard_Transient)> aPassedTypes;
|
||||
NCollection_Map<Handle(Standard_Type)> aPassedTypes;
|
||||
const Message_ListOfAlert& aList = theReport->GetAlerts (anAlertTypes[iGravity]);
|
||||
for (Message_ListOfAlert::Iterator aIt (aList); aIt.More(); aIt.Next())
|
||||
{
|
||||
|
@@ -103,7 +103,7 @@ static Standard_Boolean ChangePCurve (TopoDS_Edge& E,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void ProjCurve3d (TopoDS_Edge& E,
|
||||
static bool ProjCurve3d (TopoDS_Edge& E,
|
||||
const Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L)
|
||||
{
|
||||
@@ -111,6 +111,10 @@ static void ProjCurve3d (TopoDS_Edge& E,
|
||||
TopLoc_Location LE;
|
||||
Standard_Real f,l;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(E,LE,f,l);
|
||||
if (C.IsNull())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C,f,l);
|
||||
|
||||
TopLoc_Location LL = L.Inverted().Multiplied(LE);
|
||||
@@ -118,6 +122,7 @@ static void ProjCurve3d (TopoDS_Edge& E,
|
||||
|
||||
Handle(Geom2d_Curve) C2 = GeomProjLib::Curve2d (CT,S);
|
||||
BB.UpdateEdge(E,C2,S,L,Precision::Confusion());
|
||||
return true;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -165,13 +170,19 @@ void BRepAlgo_FaceRestrictor::Perform()
|
||||
// no pcurve on the reference surface.
|
||||
if (modeProj) {
|
||||
// Projection of the 3D curve on surface.
|
||||
ProjCurve3d ( E, S, L);
|
||||
if (!ProjCurve3d(E, S, L))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// return the first pcurve glued on <S>
|
||||
Standard_Boolean YaPCurve = ChangePCurve (E, S, L);
|
||||
if (!YaPCurve) {
|
||||
ProjCurve3d (E, S, L);
|
||||
if (!ProjCurve3d(E, S, L))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -333,7 +333,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
Only2d = Standard_True;
|
||||
|
||||
if(Only2d && Only3d) {
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
|
||||
Udeb, Ufin);
|
||||
prj = MKed.Edge();
|
||||
BB.UpdateEdge(TopoDS::Edge(prj),
|
||||
@@ -369,7 +369,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
|
||||
if(!Only3d) PCur2d = appr.Curve2d();
|
||||
if(Only2d) {
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
|
||||
Udeb, Ufin);
|
||||
prj = MKed.Edge();
|
||||
}
|
||||
|
@@ -1292,11 +1292,10 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
|
||||
for ( ;exp2.More(); exp2.Next()) {
|
||||
LOE.Append(exp2.Current());
|
||||
}
|
||||
BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol);
|
||||
//-------------------------------------------------------
|
||||
// If no trace try intersection.
|
||||
//-------------------------------------------------------
|
||||
if (LInt1.IsEmpty()) {
|
||||
if (!BRepOffset_Tool::TryProject(CF, OF1, LOE, LInt1, LInt2, mySide, myTol) || LInt1.IsEmpty()) {
|
||||
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
|
||||
}
|
||||
Store (CF,OF1,LInt1,LInt2);
|
||||
|
@@ -1175,12 +1175,16 @@ void BRepOffset_MakeOffset::MakeThickSolid(const Message_ProgressRange& theRange
|
||||
{
|
||||
NbOF++;
|
||||
}
|
||||
if (NbOF <= NbF)
|
||||
if (NbOF < NbF)
|
||||
{
|
||||
myDone = Standard_False;
|
||||
myError = BRepOffset_UnknownError;
|
||||
return;
|
||||
}
|
||||
if (NbOF == NbF)
|
||||
{
|
||||
myOffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (myOffset > 0 ) myOffsetShape.Reverse();
|
||||
|
@@ -1881,6 +1881,10 @@ Standard_Boolean BRepOffset_Tool::TryProject
|
||||
if (C.IsNull()) {
|
||||
BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE));
|
||||
C = BRep_Tool::Curve(CurE,L,f,l);
|
||||
if (C.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
C = new Geom_TrimmedCurve(C,f,l);
|
||||
if ( !L.IsIdentity()) C->Transform(L);
|
||||
@@ -3519,9 +3523,8 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
|
||||
if (ToBuild.IsBound(E)) {
|
||||
TopTools_ListOfShape LOE;
|
||||
LOE.Append(E);
|
||||
BRepOffset_Tool::TryProject (TopoDS::Face(ToBuild(E)),
|
||||
EF,LOE,LInt2,LInt1,Side,TolConf);
|
||||
if (!LInt1.IsEmpty())
|
||||
if (BRepOffset_Tool::TryProject(TopoDS::Face(ToBuild(E)), EF, LOE, LInt2, LInt1, Side, TolConf)
|
||||
&& !LInt1.IsEmpty())
|
||||
ToBuild.UnBind(E);
|
||||
}
|
||||
}
|
||||
|
@@ -120,8 +120,8 @@ private:
|
||||
|
||||
BinObjMgt_Persistent myPAtt;
|
||||
TDF_LabelList myEmptyLabels;
|
||||
TColStd_MapOfTransient myMapUnsupported;
|
||||
TColStd_IndexedMapOfTransient myTypesMap;
|
||||
NCollection_Map<Handle(Standard_Type)> myMapUnsupported;
|
||||
NCollection_IndexedMap<Handle(Standard_Type)> myTypesMap;
|
||||
BinLDrivers_VectorOfDocumentSection mySections;
|
||||
TCollection_ExtendedString myFileName;
|
||||
//! Sizes of labels and some attributes that will be stored in the second pass
|
||||
|
@@ -90,12 +90,12 @@ const Handle(Standard_Type)& BinMDF_ADriverTable::AddDerivedDriver (Standard_CSt
|
||||
//=======================================================================
|
||||
|
||||
void BinMDF_ADriverTable::AssignIds
|
||||
(const TColStd_IndexedMapOfTransient& theTypes)
|
||||
(const NCollection_IndexedMap<Handle(Standard_Type)>& theTypes)
|
||||
{
|
||||
myMapId.Clear();
|
||||
Standard_Integer i;
|
||||
for (i=1; i <= theTypes.Extent(); i++) {
|
||||
Handle(Standard_Type) aType (Handle(Standard_Type)::DownCast (theTypes(i)));
|
||||
const Handle(Standard_Type)& aType = theTypes(i);
|
||||
if (myMap.IsBound (aType)) {
|
||||
myMapId.Bind (aType, i);
|
||||
}
|
||||
@@ -141,7 +141,8 @@ void BinMDF_ADriverTable::AssignIds
|
||||
{
|
||||
if (!myMapId.IsBound2 (aStrId.Value()))
|
||||
{
|
||||
if (Handle(Standard_Type) anAdded = AddDerivedDriver (aStrId.Key().ToCString()))
|
||||
Handle(Standard_Type) anAdded = AddDerivedDriver(aStrId.Key().ToCString());
|
||||
if (!anAdded.IsNull())
|
||||
{
|
||||
myMapId.Bind (anAdded, aStrId.Value());
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
//! Assigns the IDs to the drivers of the given Types.
|
||||
//! It uses indices in the map as IDs.
|
||||
//! Useful in storage procedure.
|
||||
Standard_EXPORT void AssignIds (const TColStd_IndexedMapOfTransient& theTypes);
|
||||
Standard_EXPORT void AssignIds (const NCollection_IndexedMap<Handle(Standard_Type)>& theTypes);
|
||||
|
||||
//! Assigns the IDs to the drivers of the given Type Names;
|
||||
//! It uses indices in the sequence as IDs.
|
||||
|
@@ -47,7 +47,7 @@ Handle(TDF_Attribute) BinMDataStd_GenericEmptyDriver::NewEmpty() const
|
||||
//=======================================================================
|
||||
const Handle(Standard_Type)& BinMDataStd_GenericEmptyDriver::SourceType() const
|
||||
{
|
||||
return Standard_Type::Instance<TDataStd_GenericEmpty>();
|
||||
return STANDARD_TYPE(TDataStd_GenericEmpty);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -47,7 +47,7 @@ Handle(TDF_Attribute) BinMDataStd_GenericExtStringDriver::NewEmpty() const
|
||||
//=======================================================================
|
||||
Handle(Standard_Type)& BinMDataStd_GenericExtStringDriver::SourceType() const
|
||||
{
|
||||
static Handle(Standard_Type) aSourceType = Standard_Type::Instance<TDataStd_GenericExtString>();
|
||||
static Handle(Standard_Type) aSourceType = STANDARD_TYPE(TDataStd_GenericExtString);
|
||||
return aSourceType;
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#define _BinObjMgt_Position_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class BinObjMgt_Position;
|
||||
DEFINE_STANDARD_HANDLE (BinObjMgt_Position, Standard_Transient)
|
||||
|
@@ -841,12 +841,9 @@ Standard_Boolean BndLib_Box2dCurve::IsTypeBase
|
||||
(const Handle(Geom2d_Curve)& aC2D,
|
||||
GeomAbs_CurveType& aTypeB)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Handle(Standard_Type) aType;
|
||||
Standard_Boolean bRet=Standard_True;
|
||||
//
|
||||
bRet=Standard_True;
|
||||
//
|
||||
aType=aC2D->DynamicType();
|
||||
const Handle(Standard_Type)& aType = aC2D->DynamicType();
|
||||
if (aType==STANDARD_TYPE(Geom2d_Line)) {
|
||||
aTypeB=GeomAbs_Line;
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#define _CDF_MetaDataDriver_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class CDM_MetaData;
|
||||
class TCollection_ExtendedString;
|
||||
|
@@ -36,8 +36,7 @@ class gp_Trsf;
|
||||
//! list of edges and a list of faces.
|
||||
class DBRep_DrawableShape : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DBRep_DrawableShape, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DBRep_DrawableShape, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT DBRep_DrawableShape(const TopoDS_Shape& C, const Draw_Color& FreeCol, const Draw_Color& ConnCol, const Draw_Color& EdgeCol, const Draw_Color& IsosCol, const Standard_Real size, const Standard_Integer nbisos, const Standard_Integer discret);
|
||||
|
@@ -51,8 +51,9 @@ public:
|
||||
|
||||
//! @def Draw_Drawable3D_FACTORY
|
||||
//! Auxiliary macros defining Draw_Drawable3D restoration API to sub-class.
|
||||
#define Draw_Drawable3D_FACTORY \
|
||||
static void RegisterFactory() { Draw_Drawable3D::RegisterFactory (get_type_name(), &Restore); } \
|
||||
#define Draw_Drawable3D_FACTORY_RTTIEXT(Class,Base) \
|
||||
DEFINE_STANDARD_RTTIEXT(Class, Base) \
|
||||
static void RegisterFactory() { Draw_Drawable3D::RegisterFactory (#Class, &Restore); } \
|
||||
Standard_EXPORT static Handle(Draw_Drawable3D) Restore (Standard_IStream& theStream);
|
||||
|
||||
public:
|
||||
|
@@ -24,8 +24,7 @@ DEFINE_STANDARD_HANDLE(Draw_Number, Draw_Drawable3D)
|
||||
//! To store numbers in variables.
|
||||
class Draw_Number : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(Draw_Number, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(Draw_Number, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT Draw_Number (const Standard_Real theV);
|
||||
|
@@ -27,8 +27,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
|
||||
class DrawTrSurf_BSplineCurve : public DrawTrSurf_Curve
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
public:
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of package Geom.
|
||||
|
@@ -27,8 +27,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
class DrawTrSurf_BSplineCurve2d : public DrawTrSurf_Curve2d
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
public:
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of package Geom2d.
|
||||
|
@@ -32,8 +32,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
//! if you just want to sea boundaries and isoparametric curves.
|
||||
class DrawTrSurf_BSplineSurface : public DrawTrSurf_Surface
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
public:
|
||||
|
||||
//! default drawing mode.
|
||||
|
@@ -26,8 +26,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
|
||||
class DrawTrSurf_BezierCurve : public DrawTrSurf_Curve
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
public:
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom.
|
||||
|
@@ -26,8 +26,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
class DrawTrSurf_BezierCurve2d : public DrawTrSurf_Curve2d
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
public:
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom2d.
|
||||
|
@@ -26,8 +26,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
|
||||
class DrawTrSurf_BezierSurface : public DrawTrSurf_Surface
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
public:
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom.
|
||||
|
@@ -29,8 +29,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
//! This class defines a drawable curve in 3d space.
|
||||
class DrawTrSurf_Curve : public DrawTrSurf_Drawable
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
public:
|
||||
|
||||
//! creates a drawable curve from a curve of package Geom.
|
||||
|
@@ -29,8 +29,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
//! The curve is drawn in the plane XOY.
|
||||
class DrawTrSurf_Curve2d : public DrawTrSurf_Drawable
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
public:
|
||||
|
||||
//! creates a drawable curve from a curve of package Geom2d.
|
||||
|
@@ -29,8 +29,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
//! A drawable point.
|
||||
class DrawTrSurf_Point : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Point (const gp_Pnt& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
|
||||
|
@@ -28,8 +28,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
//! Optional display of nodes.
|
||||
class DrawTrSurf_Polygon2D : public Draw_Drawable2D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon2D (const Handle(Poly_Polygon2D)& P);
|
||||
|
@@ -28,8 +28,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
//! Optional display of nodes.
|
||||
class DrawTrSurf_Polygon3D : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon3D (const Handle(Poly_Polygon3D)& P);
|
||||
|
@@ -29,8 +29,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
//! With this class you can draw a general surface from package Geom.
|
||||
class DrawTrSurf_Surface : public DrawTrSurf_Drawable
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
public:
|
||||
|
||||
//! default drawing mode
|
||||
|
@@ -32,8 +32,7 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
//! Optional display of triangles and nodes indices.
|
||||
class DrawTrSurf_Triangulation : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Triangulation (const Handle(Poly_Triangulation)& T);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class Express_Schema;
|
||||
class TCollection_AsciiString;
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#define _Express_Field_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class Express_Type;
|
||||
class TCollection_HAsciiString;
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#define _Express_Type_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
@@ -215,7 +215,7 @@ void Geom2dAdaptor_Curve::load(const Handle(Geom2d_Curve)& C,
|
||||
myNestedEvaluator.Nullify();
|
||||
myBSplineCurve.Nullify();
|
||||
|
||||
Handle(Standard_Type) TheType = C->DynamicType();
|
||||
const Handle(Standard_Type)& TheType = C->DynamicType();
|
||||
if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
|
||||
Load(Handle(Geom2d_TrimmedCurve)::DownCast (C)->BasisCurve(),
|
||||
UFirst,ULast);
|
||||
|
@@ -50,22 +50,27 @@ static Standard_Boolean Controle(const TColgp_Array1OfPnt& Poles,
|
||||
Standard_Real umin, umax, vmin, vmax;
|
||||
S->Bounds(umin, umax, vmin, vmax);
|
||||
S->D1((umin + umax) / 2, (vmin + vmax) / 2, P, DU, DV);
|
||||
// On prend DX le plus proche possible de DU
|
||||
gp_Dir du(DU);
|
||||
Standard_Real Angle1 = du.Angle(DX);
|
||||
Standard_Real Angle2 = du.Angle(DY);
|
||||
if (Angle1 > M_PI / 2) Angle1 = M_PI - Angle1;
|
||||
if (Angle2 > M_PI / 2) Angle2 = M_PI - Angle2;
|
||||
if (Angle2 < Angle1) {
|
||||
du = DY; DY = DX; DX = du;
|
||||
}
|
||||
if (DX.Angle(DU) > M_PI / 2) DX.Reverse();
|
||||
if (DY.Angle(DV) > M_PI / 2) DY.Reverse();
|
||||
|
||||
if (DU.SquareMagnitude() > gp::Resolution() &&
|
||||
DV.SquareMagnitude() > gp::Resolution())
|
||||
{
|
||||
// On prend DX le plus proche possible de DU
|
||||
gp_Dir du(DU);
|
||||
Standard_Real Angle1 = du.Angle(DX);
|
||||
Standard_Real Angle2 = du.Angle(DY);
|
||||
if (Angle1 > M_PI / 2) Angle1 = M_PI - Angle1;
|
||||
if (Angle2 > M_PI / 2) Angle2 = M_PI - Angle2;
|
||||
if (Angle2 < Angle1) {
|
||||
du = DY; DY = DX; DX = du;
|
||||
}
|
||||
if (DX.Angle(DU) > M_PI / 2) DX.Reverse();
|
||||
if (DY.Angle(DV) > M_PI / 2) DY.Reverse();
|
||||
|
||||
gp_Ax3 axe(Bary, DX^DY, DX);
|
||||
Plan.SetPosition(axe);
|
||||
Plan.SetLocation(Bary);
|
||||
IsPlan = Standard_True;
|
||||
gp_Ax3 axe(Bary, DX^DY, DX);
|
||||
Plan.SetPosition(axe);
|
||||
Plan.SetLocation(Bary);
|
||||
IsPlan = Standard_True;
|
||||
}
|
||||
}
|
||||
return IsPlan;
|
||||
}
|
||||
|
@@ -20,10 +20,10 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <StepData_Factors.hxx>
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Axis1Placement;
|
||||
class gp_Ax1;
|
||||
class gp_Ax2d;
|
||||
@@ -43,16 +43,16 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Axis1Placement)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Axis2Placement2d;
|
||||
class gp_Ax2;
|
||||
class gp_Ax22d;
|
||||
@@ -41,10 +40,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Axis2Placement2d)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
class StepData_Factors;
|
||||
class StepGeom_Axis2Placement3d;
|
||||
class gp_Ax2;
|
||||
class gp_Ax3;
|
||||
@@ -42,19 +41,19 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors);
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Axis2Placement3d)& Value() const;
|
||||
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class Geom_BSplineCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
class StepData_Factors;
|
||||
class StepGeom_BSplineCurveWithKnots;
|
||||
|
||||
|
||||
@@ -41,10 +40,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnots)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
class Geom_BSplineCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
@@ -42,10 +41,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)& Value() const;
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepData_Factors;
|
||||
class StepGeom_BSplineSurfaceWithKnots;
|
||||
class Geom_BSplineSurface;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnots)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
class Geom_BSplineSurface;
|
||||
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_BoundedCurve;
|
||||
class Geom_BoundedCurve;
|
||||
class Geom2d_BoundedCurve;
|
||||
@@ -42,10 +41,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BoundedCurve)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_BoundedSurface;
|
||||
class Geom_BoundedSurface;
|
||||
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_BoundedSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Circle;
|
||||
class gp_Circ;
|
||||
class Geom_Circle;
|
||||
@@ -42,13 +41,13 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Circle)& Value() const;
|
||||
|
||||
|
@@ -25,7 +25,6 @@
|
||||
class StepGeom_Conic;
|
||||
class Geom_Conic;
|
||||
class Geom2d_Conic;
|
||||
class StepData_Factors;
|
||||
|
||||
|
||||
//! This class implements the mapping between classes
|
||||
@@ -40,10 +39,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Conic)& Value() const;
|
||||
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepGeom_ConicalSurface;
|
||||
class Geom_ConicalSurface;
|
||||
class StepData_Factors;
|
||||
|
||||
|
||||
//! This class implements the mapping between class
|
||||
@@ -39,7 +38,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_ConicalSurface)& Value() const;
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepData_Factors;
|
||||
class StepGeom_Curve;
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
@@ -40,10 +39,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Curve)& Value() const;
|
||||
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepGeom_CylindricalSurface;
|
||||
class Geom_CylindricalSurface;
|
||||
class StepData_Factors;
|
||||
|
||||
|
||||
//! This class implements the mapping between class
|
||||
@@ -39,7 +38,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_CylindricalSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_ElementarySurface;
|
||||
class Geom_ElementarySurface;
|
||||
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_ElementarySurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Ellipse;
|
||||
class gp_Elips;
|
||||
class Geom_Ellipse;
|
||||
@@ -42,13 +41,13 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Ellipse)& Value() const;
|
||||
|
||||
|
@@ -38,10 +38,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Hyperbola)& Value() const;
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepData_Factors;
|
||||
class StepGeom_Line;
|
||||
class gp_Lin;
|
||||
class gp_Lin2d;
|
||||
@@ -42,16 +41,16 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Line)& Value() const;
|
||||
|
||||
|
@@ -25,7 +25,6 @@
|
||||
class StepGeom_Parabola;
|
||||
class Geom2d_Parabola;
|
||||
class Geom_Parabola;
|
||||
class StepData_Factors;
|
||||
|
||||
|
||||
//! This class implements the mapping between the class
|
||||
@@ -39,10 +38,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Parabola)& Value() const;
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
class StepData_Factors;
|
||||
class StepGeom_Plane;
|
||||
class gp_Pln;
|
||||
class Geom_Plane;
|
||||
@@ -40,10 +39,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Plane)& Value() const;
|
||||
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Polyline;
|
||||
|
||||
|
||||
@@ -39,10 +38,10 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Polyline)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_RectangularTrimmedSurface;
|
||||
class Geom_RectangularTrimmedSurface;
|
||||
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_RectangularTrimmedSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_SphericalSurface;
|
||||
class Geom_SphericalSurface;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_SphericalSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Surface;
|
||||
class Geom_Surface;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Surface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_SurfaceOfLinearExtrusion;
|
||||
class Geom_SurfaceOfLinearExtrusion;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_SurfaceOfLinearExtrusion)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_SurfaceOfRevolution;
|
||||
class Geom_SurfaceOfRevolution;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_SurfaceOfRevolution)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_SweptSurface;
|
||||
class Geom_SweptSurface;
|
||||
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_SweptSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_ToroidalSurface;
|
||||
class Geom_ToroidalSurface;
|
||||
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_ToroidalSurface)& Value() const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <GeomToStep_Root.hxx>
|
||||
|
||||
class StepData_Factors;
|
||||
class StepGeom_Vector;
|
||||
class gp_Vec;
|
||||
class gp_Vec2d;
|
||||
@@ -43,16 +42,16 @@ public:
|
||||
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
Standard_EXPORT const Handle(StepGeom_Vector)& Value() const;
|
||||
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <StepData_Factors.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
@@ -25,8 +25,15 @@ enum Graphic3d_TransModeFlags
|
||||
Graphic3d_TMF_TriedronPers = 0x0020, //!< object behaves like trihedron - it is fixed at the corner of view and does not resizing (but rotating)
|
||||
Graphic3d_TMF_2d = 0x0040, //!< object is defined in 2D screen coordinates (pixels) and does not resize, pan and rotate
|
||||
Graphic3d_TMF_CameraPers = 0x0080, //!< object is in front of the camera
|
||||
Graphic3d_TMF_OrthoPers = 0x0100, //!< object is forced to be rendered with orthographic projection.
|
||||
Graphic3d_TMF_ZoomRotatePers = Graphic3d_TMF_ZoomPers
|
||||
| Graphic3d_TMF_RotatePers //!< object doesn't resize and rotate
|
||||
};
|
||||
|
||||
//! Bitwise OR operator for transform persistence mode flags. Be aware that some flags combinations are not valid.
|
||||
inline Graphic3d_TransModeFlags operator| (Graphic3d_TransModeFlags a, Graphic3d_TransModeFlags b)
|
||||
{
|
||||
return static_cast<Graphic3d_TransModeFlags> (static_cast<uint32_t> (a) | static_cast<uint32_t> (b));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -58,6 +58,12 @@ public:
|
||||
return (theMode & (Graphic3d_TMF_TriedronPers | Graphic3d_TMF_2d)) != 0;
|
||||
}
|
||||
|
||||
//! Return true if specified mode is orthographic projection transformation persistence.
|
||||
static Standard_Boolean IsOrthoPers (Graphic3d_TransModeFlags theMode)
|
||||
{
|
||||
return (theMode & Graphic3d_TMF_OrthoPers) != 0;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
//! Set transformation persistence.
|
||||
@@ -110,6 +116,9 @@ public:
|
||||
//! Return true for Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d modes.
|
||||
Standard_Boolean IsTrihedronOr2d() const { return IsTrihedronOr2d (myMode); }
|
||||
|
||||
//! Return true for Graphic3d_TMF_OrthoPers mode.
|
||||
Standard_Boolean IsOrthoPers () const { return IsOrthoPers (myMode); }
|
||||
|
||||
//! Transformation persistence mode flags.
|
||||
Graphic3d_TransModeFlags Mode() const { return myMode; }
|
||||
|
||||
@@ -297,28 +306,32 @@ public:
|
||||
//! @param theWorldView [in] the world view transformation matrix.
|
||||
//! @param theViewportWidth [in] the width of viewport (for 2d persistence).
|
||||
//! @param theViewportHeight [in] the height of viewport (for 2d persistence).
|
||||
//! @param theToApplyProjPers [in] if should apply projection persistence to matrix (for orthographic persistence).
|
||||
//! @return transformation matrix to be applied to model world transformation of an object.
|
||||
template<class T>
|
||||
NCollection_Mat4<T> Compute (const Handle(Graphic3d_Camera)& theCamera,
|
||||
const NCollection_Mat4<T>& theProjection,
|
||||
const NCollection_Mat4<T>& theWorldView,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight) const;
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Standard_Boolean theToApplyProjPers = false) const;
|
||||
|
||||
//! Apply transformation persistence on specified matrices.
|
||||
//! @param theCamera camera definition
|
||||
//! @param theProjection projection matrix to modify
|
||||
//! @param theWorldView world-view matrix to modify
|
||||
//! @param theViewportWidth viewport width
|
||||
//! @param theViewportHeight viewport height
|
||||
//! @param theAnchor if not NULL, overrides anchor point
|
||||
//! @param theCamera [in] camera definition
|
||||
//! @param theProjection [in] projection matrix to modify
|
||||
//! @param theWorldView [in/out] world-view matrix to modify
|
||||
//! @param theViewportWidth [in] viewport width
|
||||
//! @param theViewportHeight [in] viewport height
|
||||
//! @param theAnchor [in] if not NULL, overrides anchor point
|
||||
//! @param theToApplyProjPers [in] if should apply projection persistence to matrix (for orthographic persistence).
|
||||
template<class T>
|
||||
void Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
const NCollection_Mat4<T>& theProjection,
|
||||
NCollection_Mat4<T>& theWorldView,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const gp_Pnt* theAnchor = NULL) const;
|
||||
const gp_Pnt* theAnchor = NULL,
|
||||
const Standard_Boolean theToApplyProjPers = true) const;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
@@ -368,41 +381,50 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
NCollection_Mat4<T>& theWorldView,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const gp_Pnt* theAnchor) const
|
||||
const gp_Pnt* theAnchor,
|
||||
const Standard_Boolean theToApplyProjPers) const
|
||||
{
|
||||
(void )theViewportWidth;
|
||||
(void )theProjection;
|
||||
if (myMode == Graphic3d_TMF_None
|
||||
|| theViewportHeight == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Camera) aCamera = theCamera;
|
||||
if (IsOrthoPers() && !aCamera->IsOrthographic())
|
||||
{
|
||||
aCamera = new Graphic3d_Camera(*theCamera); // If OrthoPers, copy camera and set to orthographic projection
|
||||
aCamera->SetProjectionType (Graphic3d_Camera::Projection_Orthographic);
|
||||
}
|
||||
|
||||
NCollection_Mat4<Standard_Real> aWorldView = aCamera->OrientationMatrix();
|
||||
|
||||
// use total size when tiling is active
|
||||
const Standard_Integer aVPSizeY = theCamera->Tile().IsValid() ? theCamera->Tile().TotalSize.y() : theViewportHeight;
|
||||
const Standard_Integer aVPSizeY = aCamera->Tile().IsValid() ? aCamera->Tile().TotalSize.y() : theViewportHeight;
|
||||
|
||||
// a small enough jitter compensation offset
|
||||
// to avoid image dragging within single pixel in corner cases
|
||||
const Standard_Real aJitterComp = 0.001;
|
||||
if (myMode == Graphic3d_TMF_TriedronPers)
|
||||
if ((myMode & Graphic3d_TMF_TriedronPers) != 0)
|
||||
{
|
||||
// reset Z focus for trihedron persistence
|
||||
const Standard_Real aFocus = theCamera->IsOrthographic()
|
||||
? theCamera->Distance()
|
||||
: (theCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
|
||||
? Standard_Real(theCamera->ZFocus() * theCamera->Distance())
|
||||
: Standard_Real(theCamera->ZFocus()));
|
||||
const Standard_Real aFocus = aCamera->IsOrthographic()
|
||||
? aCamera->Distance()
|
||||
: (aCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
|
||||
? Standard_Real(aCamera->ZFocus() * aCamera->Distance())
|
||||
: Standard_Real(aCamera->ZFocus()));
|
||||
|
||||
// scale factor to pixels
|
||||
const gp_XYZ aViewDim = theCamera->ViewDimensions (aFocus);
|
||||
const gp_XYZ aViewDim = aCamera->ViewDimensions (aFocus);
|
||||
const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY);
|
||||
const gp_Dir aForward = theCamera->Direction();
|
||||
gp_XYZ aCenter = theCamera->Center().XYZ() + aForward.XYZ() * (aFocus - theCamera->Distance());
|
||||
const gp_Dir aForward = aCamera->Direction();
|
||||
gp_XYZ aCenter = aCamera->Center().XYZ() + aForward.XYZ() * (aFocus - aCamera->Distance());
|
||||
if ((myParams.Params2d.Corner & (Aspect_TOTP_LEFT | Aspect_TOTP_RIGHT)) != 0)
|
||||
{
|
||||
const Standard_Real anOffsetX = (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale;
|
||||
const gp_Dir aSide = aForward.Crossed (theCamera->Up());
|
||||
const gp_XYZ aDeltaX = aSide.XYZ() * (Abs(aViewDim.X()) * theCamera->NDC2dOffsetX() - anOffsetX);
|
||||
const gp_Dir aSide = aForward.Crossed (aCamera->Up());
|
||||
const gp_XYZ aDeltaX = aSide.XYZ() * (Abs(aViewDim.X()) * aCamera->NDC2dOffsetX() - anOffsetX);
|
||||
if ((myParams.Params2d.Corner & Aspect_TOTP_RIGHT) != 0)
|
||||
{
|
||||
aCenter += aDeltaX;
|
||||
@@ -415,7 +437,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
if ((myParams.Params2d.Corner & (Aspect_TOTP_TOP | Aspect_TOTP_BOTTOM)) != 0)
|
||||
{
|
||||
const Standard_Real anOffsetY = (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale;
|
||||
const gp_XYZ aDeltaY = theCamera->Up().XYZ() * (Abs(aViewDim.Y()) * theCamera->NDC2dOffsetY() - anOffsetY);
|
||||
const gp_XYZ aDeltaY = aCamera->Up().XYZ() * (Abs(aViewDim.Y()) * aCamera->NDC2dOffsetY() - anOffsetY);
|
||||
if ((myParams.Params2d.Corner & Aspect_TOTP_TOP) != 0)
|
||||
{
|
||||
aCenter += aDeltaY;
|
||||
@@ -426,27 +448,24 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
}
|
||||
}
|
||||
|
||||
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
|
||||
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
|
||||
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
||||
theWorldView.ConvertFrom (aWorldView);
|
||||
return;
|
||||
}
|
||||
else if (myMode == Graphic3d_TMF_2d)
|
||||
else if ((myMode & Graphic3d_TMF_2d) != 0)
|
||||
{
|
||||
const Standard_Real aFocus = theCamera->IsOrthographic()
|
||||
? theCamera->Distance()
|
||||
: (theCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
|
||||
? Standard_Real(theCamera->ZFocus() * theCamera->Distance())
|
||||
: Standard_Real(theCamera->ZFocus()));
|
||||
const Standard_Real aFocus = aCamera->IsOrthographic()
|
||||
? aCamera->Distance()
|
||||
: (aCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
|
||||
? Standard_Real(aCamera->ZFocus() * aCamera->Distance())
|
||||
: Standard_Real(aCamera->ZFocus()));
|
||||
|
||||
// scale factor to pixels
|
||||
const gp_XYZ aViewDim = theCamera->ViewDimensions (aFocus);
|
||||
const gp_XYZ aViewDim = aCamera->ViewDimensions (aFocus);
|
||||
const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY);
|
||||
gp_XYZ aCenter (0.0, 0.0, -aFocus);
|
||||
if ((myParams.Params2d.Corner & (Aspect_TOTP_LEFT | Aspect_TOTP_RIGHT)) != 0)
|
||||
{
|
||||
aCenter.SetX (-aViewDim.X() * theCamera->NDC2dOffsetX() + (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale);
|
||||
aCenter.SetX (-aViewDim.X() * aCamera->NDC2dOffsetX() + (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale);
|
||||
if ((myParams.Params2d.Corner & Aspect_TOTP_RIGHT) != 0)
|
||||
{
|
||||
aCenter.SetX (-aCenter.X());
|
||||
@@ -454,26 +473,24 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
}
|
||||
if ((myParams.Params2d.Corner & (Aspect_TOTP_TOP | Aspect_TOTP_BOTTOM)) != 0)
|
||||
{
|
||||
aCenter.SetY (-aViewDim.Y() * theCamera->NDC2dOffsetY() + (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale);
|
||||
aCenter.SetY (-aViewDim.Y() * aCamera->NDC2dOffsetY() + (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale);
|
||||
if ((myParams.Params2d.Corner & Aspect_TOTP_TOP) != 0)
|
||||
{
|
||||
aCenter.SetY (-aCenter.Y());
|
||||
}
|
||||
}
|
||||
|
||||
theWorldView.InitIdentity();
|
||||
Graphic3d_TransformUtils::Translate (theWorldView, T(aCenter.X()), T(aCenter.Y()), T(aCenter.Z()));
|
||||
Graphic3d_TransformUtils::Scale (theWorldView, T(aScale), T(aScale), T(aScale));
|
||||
return;
|
||||
aWorldView.InitIdentity();
|
||||
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
|
||||
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
||||
}
|
||||
else if ((myMode & Graphic3d_TMF_CameraPers) != 0)
|
||||
{
|
||||
theWorldView.InitIdentity();
|
||||
aWorldView.InitIdentity();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Compute reference point for transformation in untransformed projection space.
|
||||
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
|
||||
if (theAnchor != NULL)
|
||||
{
|
||||
Graphic3d_TransformUtils::Translate (aWorldView, theAnchor->X(), theAnchor->Y(), theAnchor->Z());
|
||||
@@ -503,12 +520,19 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
if ((myMode & Graphic3d_TMF_ZoomPers) != 0)
|
||||
{
|
||||
// lock zooming
|
||||
Standard_Real aScale = persistentScale (theCamera, theViewportWidth, theViewportHeight);
|
||||
Standard_Real aScale = persistentScale (aCamera, theViewportWidth, theViewportHeight);
|
||||
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
||||
}
|
||||
theWorldView.ConvertFrom (aWorldView);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!theCamera->IsOrthographic() && IsOrthoPers() && theToApplyProjPers)
|
||||
{
|
||||
Graphic3d_Mat4d aProjInv;
|
||||
aProjInv.ConvertFrom (theProjection.Inverted());
|
||||
aWorldView = (aProjInv * aCamera->ProjectionMatrix()) * aWorldView;
|
||||
}
|
||||
|
||||
theWorldView.ConvertFrom (aWorldView);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -555,7 +579,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
const Standard_Integer theViewportHeight,
|
||||
BVH_Box<T, 3>& theBoundingBox) const
|
||||
{
|
||||
NCollection_Mat4<T> aTPers = Compute (theCamera, theProjection, theWorldView, theViewportWidth, theViewportHeight);
|
||||
NCollection_Mat4<T> aTPers = Compute (theCamera, theProjection, theWorldView, theViewportWidth, theViewportHeight, false);
|
||||
if (aTPers.IsIdentity()
|
||||
|| !theBoundingBox.IsValid())
|
||||
{
|
||||
@@ -594,7 +618,8 @@ NCollection_Mat4<T> Graphic3d_TransformPers::Compute (const Handle(Graphic3d_Cam
|
||||
const NCollection_Mat4<T>& theProjection,
|
||||
const NCollection_Mat4<T>& theWorldView,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight) const
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Standard_Boolean theToApplyProjPers) const
|
||||
{
|
||||
if (myMode == Graphic3d_TMF_None)
|
||||
{
|
||||
@@ -610,7 +635,7 @@ NCollection_Mat4<T> Graphic3d_TransformPers::Compute (const Handle(Graphic3d_Cam
|
||||
|
||||
// compute only world-view matrix difference to avoid floating point instability
|
||||
// caused by projection matrix modifications outside of this algorithm (e.g. by Z-fit)
|
||||
Apply (theCamera, theProjection, aWorldView, theViewportWidth, theViewportHeight);
|
||||
Apply (theCamera, theProjection, aWorldView, theViewportWidth, theViewportHeight, NULL, theToApplyProjPers);
|
||||
return anUnviewMat * aWorldView;
|
||||
}
|
||||
|
||||
|
@@ -26,8 +26,7 @@ DEFINE_STANDARD_HANDLE(HLRTest_Projector, Draw_Drawable3D)
|
||||
//! Draw Variable Projector to test.
|
||||
class HLRTest_Projector : public Draw_Drawable3D
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(HLRTest_Projector, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
Draw_Drawable3D_FACTORY_RTTIEXT(HLRTest_Projector, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
Standard_EXPORT HLRTest_Projector(const HLRAlgo_Projector& P);
|
||||
|
@@ -32,9 +32,10 @@ Standard_Boolean IFSelect_SignAncestor::Matches(const Handle(Standard_Transient)
|
||||
const TCollection_AsciiString& text,
|
||||
const Standard_Boolean /*exact*/) const
|
||||
{
|
||||
if (ent.IsNull()) return Standard_False;
|
||||
DeclareAndCast(Standard_Type,atype,ent);
|
||||
if (atype.IsNull()) atype = ent->DynamicType();
|
||||
return atype->SubType(text.ToCString());
|
||||
return false;
|
||||
// if (ent.IsNull()) return Standard_False;
|
||||
// DeclareAndCast(Standard_Type,atype,ent);
|
||||
// if (atype.IsNull()) atype = ent->DynamicType();
|
||||
// return atype->SubType(text.ToCString());
|
||||
}
|
||||
|
||||
|
@@ -33,8 +33,7 @@ static Standard_CString nulsign = "";
|
||||
const Handle(Interface_InterfaceModel)& /*model*/) const
|
||||
{
|
||||
if (ent.IsNull()) return nulsign;
|
||||
DeclareAndCast(Standard_Type,atype,ent);
|
||||
if (atype.IsNull()) atype = ent->DynamicType();
|
||||
Handle(Standard_Type) atype = ent->DynamicType();
|
||||
Standard_CString tn = atype->Name();
|
||||
if (!thenopk) return tn;
|
||||
for (int i = 0; tn[i] != '\0'; i ++) {
|
||||
|
@@ -250,7 +250,7 @@ Standard_Boolean Interface_FileReaderTool::RecognizeByLib(const Standard_Integer
|
||||
}
|
||||
if (CN <= 0 || proto.IsNull()) return Standard_False;
|
||||
// Se recaler dans GeneralLib : Creation de l entite vide
|
||||
Handle(Standard_Type) typrot = proto->DynamicType();
|
||||
const Handle(Standard_Type)& typrot = proto->DynamicType();
|
||||
for (glib.Start(); glib.More(); glib.Next()) {
|
||||
proto = glib.Protocol();
|
||||
if (proto.IsNull()) continue;
|
||||
|
@@ -110,8 +110,8 @@ private:
|
||||
Handle(Interface_Protocol) theproto;
|
||||
Handle(Interface_SignType) thesign;
|
||||
Interface_GeneralLib thelib;
|
||||
Interface_DataMapOfTransientInteger thentnum;
|
||||
TColStd_IndexedDataMapOfTransientTransient thentmod;
|
||||
NCollection_DataMap<Handle(Standard_Type),Standard_Integer> thentnum;
|
||||
NCollection_IndexedDataMap<Handle(Standard_Type),Handle(Standard_Transient)> thentmod;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define _Message_Alert_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Message_Alert, Standard_Transient)
|
||||
|
||||
|
@@ -223,13 +223,9 @@ void Message_Algorithm::SendStatusMessages (const Message_ExecStatus& theStatus,
|
||||
|
||||
// find message, prefixed by class type name, iterating by base classes if necessary
|
||||
TCollection_AsciiString aMsgName;
|
||||
for (Handle(Standard_Type) aType = DynamicType(); ! aType.IsNull(); aType = aType->Parent())
|
||||
{
|
||||
Handle(Standard_Type) aType = DynamicType();
|
||||
aMsgName = aType->Name();
|
||||
aMsgName += aSuffix;
|
||||
if (Message_MsgFile::HasMsg(aMsgName))
|
||||
break;
|
||||
}
|
||||
|
||||
// create a message
|
||||
Message_Msg aMsg ( aMsgName );
|
||||
|
@@ -76,7 +76,7 @@ void OSD_ThreadPool::EnumeratedThread::WaitIdle()
|
||||
myIdleEvent.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
#include <thread>
|
||||
// =======================================================================
|
||||
// function : DefaultPool
|
||||
// purpose :
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define OpenGl_Element_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class Graphic3d_FrameStatsDataTmp;
|
||||
class OpenGl_Workspace;
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define OpenGl_Resource_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class OpenGl_Context;
|
||||
|
||||
|
@@ -98,6 +98,8 @@
|
||||
#include <RWStepBasic_RWExternalIdentificationAssignment.hxx>
|
||||
#include <RWStepBasic_RWExternallyDefinedItem.hxx>
|
||||
#include <RWStepBasic_RWGeneralProperty.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <RWStepBasic_RWGroupRelationship.hxx>
|
||||
#include <RWStepBasic_RWIdentificationAssignment.hxx>
|
||||
#include <RWStepBasic_RWIdentificationRole.hxx>
|
||||
@@ -325,6 +327,7 @@
|
||||
#include <RWStepRepr_RWMaterialDesignation.hxx>
|
||||
#include <RWStepRepr_RWMaterialProperty.hxx>
|
||||
#include <RWStepRepr_RWMaterialPropertyRepresentation.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <RWStepRepr_RWMeasureRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWProductConcept.hxx>
|
||||
#include <RWStepRepr_RWProductDefinitionShape.hxx>
|
||||
@@ -570,6 +573,8 @@
|
||||
#include <StepBasic_ExternalIdentificationAssignment.hxx>
|
||||
#include <StepBasic_ExternalSource.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_Group.hxx>
|
||||
#include <StepBasic_GroupRelationship.hxx>
|
||||
#include <StepBasic_IdentificationAssignment.hxx>
|
||||
@@ -785,6 +790,7 @@
|
||||
#include <StepRepr_ConfigurationEffectivity.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <StepRepr_DataEnvironment.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
#include <StepRepr_Extension.hxx>
|
||||
@@ -1188,7 +1194,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule)
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
|
||||
@@ -5876,6 +5884,27 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anEnt, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
@@ -8185,6 +8214,21 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 819:
|
||||
ent = new StepVisual_TriangulatedSurfaceSet;
|
||||
break;
|
||||
case 820:
|
||||
ent = new StepBasic_GeneralPropertyAssociation;
|
||||
break;
|
||||
case 821:
|
||||
ent = new StepBasic_GeneralPropertyRelationship;
|
||||
break;
|
||||
case 822:
|
||||
ent = new StepRepr_BooleanRepresentationItem;
|
||||
break;
|
||||
case 823:
|
||||
ent = new StepRepr_RealRepresentationItem;
|
||||
break;
|
||||
case 824:
|
||||
ent = new StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
break;
|
||||
|
||||
default:
|
||||
return Standard_False;
|
||||
|
@@ -188,6 +188,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_Group.hxx>
|
||||
#include <StepBasic_GroupRelationship.hxx>
|
||||
#include <StepShape_HalfSpaceSolid.hxx>
|
||||
@@ -622,6 +624,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <RWStepRepr_RWGlobalUncertaintyAssignedContext.hxx>
|
||||
#include <RWStepRepr_RWGlobalUnitAssignedContext.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <RWStepBasic_RWGroup.hxx>
|
||||
#include <RWStepBasic_RWGroupRelationship.hxx>
|
||||
#include <RWStepShape_RWHalfSpaceSolid.hxx>
|
||||
@@ -637,6 +641,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepShape_RWManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <RWStepRepr_RWMappedItem.hxx>
|
||||
#include <RWStepBasic_RWMeasureWithUnit.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <RWStepVisual_RWMechanicalDesignGeometricPresentationArea.hxx>
|
||||
#include <RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.hxx>
|
||||
// Removed from Rev2 to Rev4 : <RWStepVisual_RWMechanicalDesignPresentationArea.hxx>
|
||||
@@ -1355,7 +1360,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWBooleanRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWRealRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
|
||||
@@ -1406,7 +1413,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
|
||||
@@ -1423,6 +1432,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepRepr_CharacterizedRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
|
||||
#include <RWStepVisual_RWTessellatedAnnotationOccurrence.hxx>
|
||||
#include <RWStepVisual_RWTessellatedItem.hxx>
|
||||
@@ -2352,6 +2362,11 @@ static TCollection_AsciiString Reco_ComplexTriangulatedSurfaceSet("COMPLEX_TRIAN
|
||||
static TCollection_AsciiString Reco_CubicBezierTessellatedEdge("CUBIC_BEZIER_TESSELLATED_EDGE");
|
||||
static TCollection_AsciiString Reco_CubicBezierTriangulatedFace("CUBIC_BEZIER_TRIANGULATED_FACE");
|
||||
static TCollection_AsciiString Reco_TriangulatedSurfaceSet("TRIANGULATED_SURFACE_SET");
|
||||
static TCollection_AsciiString Reco_GeneralPropertyAssociation("GENERAL_PROPERTY_ASSOCIATION");
|
||||
static TCollection_AsciiString Reco_GeneralPropertyRelationship("GENERAL_PROPERTY_RELATIONSHIP");
|
||||
static TCollection_AsciiString Reco_BooleanRepresentationItem("BOOLEAN_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_RealRepresentationItem("REAL_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_MechanicalDesignAndDraughtingRelationship("MECHANICAL_DESIGN_AND_DRAUGHTING_RELATIONSHIP");
|
||||
|
||||
// -- Definition of the libraries --
|
||||
|
||||
@@ -3109,6 +3124,11 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
typenums.Bind(Reco_CubicBezierTessellatedEdge, 817);
|
||||
typenums.Bind(Reco_CubicBezierTriangulatedFace, 818);
|
||||
typenums.Bind(Reco_TriangulatedSurfaceSet, 819);
|
||||
typenums.Bind(Reco_GeneralPropertyAssociation, 820);
|
||||
typenums.Bind(Reco_GeneralPropertyRelationship, 821);
|
||||
typenums.Bind(Reco_BooleanRepresentationItem, 822);
|
||||
typenums.Bind(Reco_RealRepresentationItem, 823);
|
||||
typenums.Bind(Reco_MechanicalDesignAndDraughtingRelationship, 824);
|
||||
|
||||
|
||||
// SHORT NAMES
|
||||
@@ -5097,6 +5117,11 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
|
||||
case 817: return Reco_CubicBezierTessellatedEdge;
|
||||
case 818: return Reco_CubicBezierTriangulatedFace;
|
||||
case 819: return Reco_TriangulatedSurfaceSet;
|
||||
case 820: return Reco_GeneralPropertyAssociation;
|
||||
case 821: return Reco_GeneralPropertyRelationship;
|
||||
case 822: return Reco_BooleanRepresentationItem;
|
||||
case 823: return Reco_RealRepresentationItem;
|
||||
case 824: return Reco_MechanicalDesignAndDraughtingRelationship;
|
||||
default : return PasReco;
|
||||
}
|
||||
}
|
||||
@@ -10706,6 +10731,41 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 822:
|
||||
{
|
||||
DeclareAndCast(StepRepr_BooleanRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWBooleanRepresentationItem aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
case 823:
|
||||
{
|
||||
DeclareAndCast(StepRepr_RealRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWRealRepresentationItem aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anent, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ach->AddFail("Type Mismatch when reading - Entity");
|
||||
}
|
||||
@@ -16257,6 +16317,41 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 822:
|
||||
{
|
||||
DeclareAndCast(StepRepr_BooleanRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWBooleanRepresentationItem aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
case 823:
|
||||
{
|
||||
DeclareAndCast(StepRepr_RealRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWRealRepresentationItem aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anent, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@@ -108,6 +108,10 @@ RWStepBasic_RWExternalSource.cxx
|
||||
RWStepBasic_RWExternalSource.hxx
|
||||
RWStepBasic_RWGeneralProperty.cxx
|
||||
RWStepBasic_RWGeneralProperty.hxx
|
||||
RWStepBasic_RWGeneralPropertyAssociation.cxx
|
||||
RWStepBasic_RWGeneralPropertyAssociation.hxx
|
||||
RWStepBasic_RWGeneralPropertyRelationship.cxx
|
||||
RWStepBasic_RWGeneralPropertyRelationship.hxx
|
||||
RWStepBasic_RWGroup.cxx
|
||||
RWStepBasic_RWGroup.hxx
|
||||
RWStepBasic_RWGroupAssignment.cxx
|
||||
|
87
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.cxx
Normal file
87
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.cxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepBasic_RWGeneralPropertyAssociation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepBasic_RWGeneralPropertyAssociation::RWStepBasic_RWGeneralPropertyAssociation()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "general_property_association")) return;
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString(theNum, 1, "name", theAch, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
theData->ReadString(theNum, 2, "description", theAch, aDescription);
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aGeneralProperty;
|
||||
theData->ReadEntity(theNum, 3, "base_definition", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aGeneralProperty);
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aPropertyDefinition;
|
||||
theData->ReadEntity(theNum, 4, "derived_definition", theAch, STANDARD_TYPE(StepRepr_PropertyDefinition), aPropertyDefinition);
|
||||
|
||||
// Initialize entity
|
||||
theEnt->Init(aName,
|
||||
aDescription,
|
||||
aGeneralProperty,
|
||||
aPropertyDefinition);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation) &theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
theSW.Send(theEnt->Description());
|
||||
|
||||
theSW.Send(theEnt->GeneralProperty());
|
||||
|
||||
theSW.Send(theEnt->PropertyDefinition());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::Share(const Handle(StepBasic_GeneralPropertyAssociation)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.AddItem(theEnt->GeneralProperty());
|
||||
|
||||
theIter.AddItem(theEnt->PropertyDefinition());
|
||||
}
|
60
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.hxx
Normal file
60
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.hxx
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
||||
#define _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepBasic_GeneralProperty;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
class StepBasic_GeneralPropertyAssociation;
|
||||
|
||||
//! Read & Write tool for GeneralPropertyAssociation
|
||||
class RWStepBasic_RWGeneralPropertyAssociation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepBasic_RWGeneralPropertyAssociation();
|
||||
|
||||
//! Reads GeneralPropertyAssociation
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const;
|
||||
|
||||
//! Writes GeneralPropertyAssociation
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepBasic_GeneralPropertyAssociation)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
103
src/RWStepBasic/RWStepBasic_RWGeneralPropertyRelationship.cxx
Normal file
103
src/RWStepBasic/RWStepBasic_RWGeneralPropertyRelationship.cxx
Normal file
@@ -0,0 +1,103 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepBasic_RWGeneralPropertyRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepBasic_RWGeneralPropertyRelationship::RWStepBasic_RWGeneralPropertyRelationship()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "general_property_association")) return;
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString(theNum, 1, "name", theAch, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
Standard_Boolean hasDescription = Standard_True;
|
||||
if (theData->IsParamDefined(theNum, 2))
|
||||
{
|
||||
theData->ReadString(theNum, 2, "description", theAch, aDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasDescription = Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aRelatingGeneralProperty;
|
||||
theData->ReadEntity(theNum, 3, "relating_property", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aRelatingGeneralProperty);
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aRelatedGeneralProperty;
|
||||
theData->ReadEntity(theNum, 4, "related_property", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aRelatedGeneralProperty);
|
||||
|
||||
// Initialize entity
|
||||
theEnt->Init(aName,
|
||||
hasDescription,
|
||||
aDescription,
|
||||
aRelatingGeneralProperty,
|
||||
aRelatedGeneralProperty);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
if (theEnt->HasDescription())
|
||||
{
|
||||
theSW.Send(theEnt->Description());
|
||||
}
|
||||
else
|
||||
{
|
||||
theSW.SendUndef();
|
||||
}
|
||||
|
||||
theSW.Send(theEnt->RelatingGeneralProperty());
|
||||
|
||||
theSW.Send(theEnt->RelatedGeneralProperty());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::Share(const Handle(StepBasic_GeneralPropertyRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.AddItem(theEnt->RelatingGeneralProperty());
|
||||
|
||||
theIter.AddItem(theEnt->RelatedGeneralProperty());
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
||||
#define _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepBasic_GeneralProperty;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
class StepBasic_GeneralPropertyRelationship;
|
||||
|
||||
//! Read & Write tool for GeneralPropertyRelationship
|
||||
class RWStepBasic_RWGeneralPropertyRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepBasic_RWGeneralPropertyRelationship();
|
||||
|
||||
//! Reads GeneralPropertyAssociation
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const;
|
||||
|
||||
//! Writes GeneralPropertyAssociation
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepBasic_GeneralPropertyRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
@@ -91,7 +91,14 @@ void RWStepBasic_RWProduct::WriteStep
|
||||
|
||||
// --- own field : description ---
|
||||
|
||||
SW.Send(ent->Description());
|
||||
if (!ent->Description().IsNull())
|
||||
{
|
||||
SW.Send(ent->Description());
|
||||
}
|
||||
else
|
||||
{
|
||||
SW.SendUndef();
|
||||
}
|
||||
|
||||
// --- own field : frameOfReference ---
|
||||
|
||||
|
@@ -78,7 +78,14 @@ void RWStepBasic_RWProductDefinition::WriteStep
|
||||
|
||||
// --- own field : description ---
|
||||
|
||||
SW.Send(ent->Description());
|
||||
if (!ent->Description().IsNull())
|
||||
{
|
||||
SW.Send(ent->Description());
|
||||
}
|
||||
else
|
||||
{
|
||||
SW.SendUndef();
|
||||
}
|
||||
|
||||
// --- own field : formation ---
|
||||
|
||||
|
@@ -71,7 +71,14 @@ void RWStepBasic_RWProductDefinitionFormation::WriteStep
|
||||
|
||||
// --- own field : description ---
|
||||
|
||||
SW.Send(ent->Description());
|
||||
if (!ent->Description().IsNull())
|
||||
{
|
||||
SW.Send(ent->Description());
|
||||
}
|
||||
else
|
||||
{
|
||||
SW.SendUndef();
|
||||
}
|
||||
|
||||
// --- own field : ofProduct ---
|
||||
|
||||
|
@@ -8,6 +8,8 @@ RWStepRepr_RWAssemblyComponentUsageSubstitute.cxx
|
||||
RWStepRepr_RWAssemblyComponentUsageSubstitute.hxx
|
||||
RWStepRepr_RWBetweenShapeAspect.cxx
|
||||
RWStepRepr_RWBetweenShapeAspect.hxx
|
||||
RWStepRepr_RWBooleanRepresentationItem.cxx
|
||||
RWStepRepr_RWBooleanRepresentationItem.hxx
|
||||
RWStepRepr_RWCentreOfSymmetry.cxx
|
||||
RWStepRepr_RWCentreOfSymmetry.hxx
|
||||
RWStepRepr_RWCharacterizedRepresentation.cxx
|
||||
@@ -70,6 +72,8 @@ RWStepRepr_RWMaterialPropertyRepresentation.cxx
|
||||
RWStepRepr_RWMaterialPropertyRepresentation.hxx
|
||||
RWStepRepr_RWMeasureRepresentationItem.cxx
|
||||
RWStepRepr_RWMeasureRepresentationItem.hxx
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.cxx
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx
|
||||
RWStepRepr_RWParallelOffset.cxx
|
||||
RWStepRepr_RWParallelOffset.hxx
|
||||
RWStepRepr_RWParametricRepresentationContext.cxx
|
||||
@@ -88,6 +92,8 @@ RWStepRepr_RWPropertyDefinitionRepresentation.cxx
|
||||
RWStepRepr_RWPropertyDefinitionRepresentation.hxx
|
||||
RWStepRepr_RWQuantifiedAssemblyComponentUsage.cxx
|
||||
RWStepRepr_RWQuantifiedAssemblyComponentUsage.hxx
|
||||
RWStepRepr_RWRealRepresentationItem.cxx
|
||||
RWStepRepr_RWRealRepresentationItem.hxx
|
||||
RWStepRepr_RWRepresentation.cxx
|
||||
RWStepRepr_RWRepresentation.hxx
|
||||
RWStepRepr_RWRepresentationContext.cxx
|
||||
|
50
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.cxx
Normal file
50
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <RWStepRepr_RWBooleanRepresentationItem.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
RWStepRepr_RWBooleanRepresentationItem::RWStepRepr_RWBooleanRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void RWStepRepr_RWBooleanRepresentationItem::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 2, theAch, "boolean_representation_item") ) return;
|
||||
|
||||
// --- inherited field : name ---
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// --- own field : value ---
|
||||
Standard_Boolean aValue;
|
||||
theData->ReadBoolean (theNum, 2, "value", theAch, aValue);
|
||||
|
||||
//--- Initialisation of the read entity ---
|
||||
theEnt->Init(aName, aValue);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWBooleanRepresentationItem::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
theSW.Send(theEnt->Value());
|
||||
}
|
45
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.hxx
Normal file
45
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
||||
#define _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_BooleanRepresentationItem;
|
||||
class StepData_StepWriter;
|
||||
|
||||
|
||||
//! Read & Write Module for BooleanRepresentationItem
|
||||
class RWStepRepr_RWBooleanRepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWBooleanRepresentationItem();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const;
|
||||
};
|
||||
#endif // _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
@@ -0,0 +1,78 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_Representation.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship() {}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "mechanical_design_and_draughting_relationship")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// Inherited field : description
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
if (theData->IsParamDefined (theNum, 2)) {
|
||||
theData->ReadString (theNum, 2, "description", theAch, aDescription);
|
||||
}
|
||||
// Inherited field : rep_1
|
||||
Handle(StepRepr_Representation) aRep1;
|
||||
theData->ReadEntity(theNum, 3, "rep_1", theAch, STANDARD_TYPE(StepRepr_Representation), aRep1);
|
||||
|
||||
// Inherited field : rep_2
|
||||
Handle(StepRepr_Representation) aRep2;
|
||||
theData->ReadEntity(theNum, 4, "rep_2", theAch, STANDARD_TYPE(StepRepr_Representation), aRep2);
|
||||
|
||||
// Initialisation of the read entity
|
||||
theEnt->Init(aName, aDescription, aRep1, aRep2);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::WriteStep
|
||||
(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const
|
||||
{
|
||||
// Inherited field : name
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
// Inherited field : description
|
||||
theSW.Send(theEnt->Description());
|
||||
|
||||
// Inherited field : rep_1
|
||||
theSW.Send(theEnt->Rep1());
|
||||
|
||||
// Inherited field : rep_2
|
||||
theSW.Send(theEnt->Rep2());
|
||||
}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::Share
|
||||
(const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.GetOneItem(theEnt->Rep1());
|
||||
theIter.GetOneItem(theEnt->Rep2());
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
#define _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write Module for MechanicalDesignAndDraughtingRelationship
|
||||
class RWStepRepr_RWMechanicalDesignAndDraughtingRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWMechanicalDesignAndDraughtingRelationship();
|
||||
|
||||
Standard_EXPORT void ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void Share(const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
};
|
||||
#endif // _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
50
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.cxx
Normal file
50
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <RWStepRepr_RWRealRepresentationItem.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
RWStepRepr_RWRealRepresentationItem::RWStepRepr_RWRealRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void RWStepRepr_RWRealRepresentationItem::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams (theNum, 2, theAch, "real_representation_item")) return;
|
||||
|
||||
// --- inherited field : name ---
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// --- own field : value ---
|
||||
Standard_Real aValue;
|
||||
theData->ReadReal (theNum, 2, "value", theAch, aValue);
|
||||
|
||||
//--- Initialisation of the read entity ---
|
||||
theEnt->Init(aName, aValue);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWRealRepresentationItem::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
theSW.Send(theEnt->Value());
|
||||
}
|
46
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.hxx
Normal file
46
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.hxx
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
||||
#define _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_RealRepresentationItem;
|
||||
class StepData_StepWriter;
|
||||
|
||||
|
||||
//! Read & Write Module for RealRepresentationItem
|
||||
class RWStepRepr_RWRealRepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWRealRepresentationItem();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const;
|
||||
};
|
||||
#endif // _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
@@ -116,6 +116,8 @@ bool STEPCAFControl_ConfigurationNode::Load(const Handle(DE_ConfigurationContext
|
||||
theResource->BooleanVal("read.layer", InternalParameters.ReadLayer, aScope);
|
||||
InternalParameters.ReadProps =
|
||||
theResource->BooleanVal("read.props", InternalParameters.ReadProps, aScope);
|
||||
InternalParameters.ReadMetadata =
|
||||
theResource->BooleanVal("read.metadata", InternalParameters.ReadMetadata, aScope);
|
||||
|
||||
InternalParameters.WritePrecisionMode = (StepData_ConfParameters::WriteMode_PrecisionMode)
|
||||
theResource->IntegerVal("write.precision.mode", InternalParameters.WritePrecisionMode, aScope);
|
||||
@@ -370,6 +372,12 @@ TCollection_AsciiString STEPCAFControl_ConfigurationNode::Save() const
|
||||
aResult += aScope + "read.props :\t " + InternalParameters.ReadProps + "\n";
|
||||
aResult += "!\n";
|
||||
|
||||
aResult += "!\n";
|
||||
aResult += "!Setting up the read.metadata parameter which is used to indicate read Metadata or not\n";
|
||||
aResult += "!Default value: 1(\"ON\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
|
||||
aResult += aScope + "read.metadata :\t " + InternalParameters.ReadMetadata + "\n";
|
||||
aResult += "!\n";
|
||||
|
||||
aResult += "!\n";
|
||||
aResult += "!Write Parameters:\n";
|
||||
aResult += "!\n";
|
||||
|
@@ -73,6 +73,8 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
|
||||
aReader.SetNameMode(aNode->InternalParameters.ReadName);
|
||||
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
|
||||
aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
|
||||
aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
|
||||
|
||||
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
|
||||
StepData_ConfParameters aParams;
|
||||
aReadStat = aReader.ReadFile(thePath.ToCString(), aParams);
|
||||
|
@@ -30,9 +30,12 @@
|
||||
#include <StepBasic_ConversionBasedUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndMassUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndTimeUnit.hxx>
|
||||
#include <StepBasic_DerivedUnit.hxx>
|
||||
#include <StepBasic_DerivedUnitElement.hxx>
|
||||
#include <StepBasic_DocumentFile.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_MeasureValueMember.hxx>
|
||||
#include <StepBasic_NamedUnit.hxx>
|
||||
#include <StepBasic_Product.hxx>
|
||||
@@ -40,6 +43,9 @@
|
||||
#include <StepBasic_ProductDefinitionFormation.hxx>
|
||||
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
|
||||
#include <StepBasic_SiUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndMassUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndThermodynamicTemperatureUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndTimeUnit.hxx>
|
||||
#include <STEPCAFControl_Controller.hxx>
|
||||
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
|
||||
#include <STEPCAFControl_DataMapOfShapePD.hxx>
|
||||
@@ -129,6 +135,7 @@
|
||||
#include <StepShape_DimensionalLocation.hxx>
|
||||
#include <StepShape_EdgeCurve.hxx>
|
||||
#include <StepShape_EdgeLoop.hxx>
|
||||
#include <StepShape_GeometricCurveSet.hxx>
|
||||
#include <StepShape_GeometricSet.hxx>
|
||||
#include <StepShape_HArray1OfFace.hxx>
|
||||
#include <StepShape_HArray1OfFaceBound.hxx>
|
||||
@@ -214,6 +221,7 @@
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepAP242_GeometricItemSpecificUsage.hxx>
|
||||
#include <StepAP242_IdAttribute.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <STEPCAFControl_GDTProperty.hxx>
|
||||
#include <StepVisual_TessellatedAnnotationOccurrence.hxx>
|
||||
@@ -225,7 +233,15 @@
|
||||
#include <StepVisual_OverRidingStyledItem.hxx>
|
||||
#include <StepVisual_ContextDependentOverRidingStyledItem.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_ItemDefinedTransformation.hxx>
|
||||
#include <StepRepr_PropertyDefinitionRelationship.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
|
||||
|
||||
#include <TColgp_HArray1OfXYZ.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
@@ -275,6 +291,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader()
|
||||
myNameMode(Standard_True),
|
||||
myLayerMode(Standard_True),
|
||||
myPropsMode(Standard_True),
|
||||
myMetaMode(Standard_True),
|
||||
mySHUOMode(Standard_False),
|
||||
myGDTMode(Standard_True),
|
||||
myMatMode(Standard_True),
|
||||
@@ -299,6 +316,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader(const Handle(XSControl_WorkSession)
|
||||
myNameMode(Standard_True),
|
||||
myLayerMode(Standard_True),
|
||||
myPropsMode(Standard_True),
|
||||
myMetaMode(Standard_True),
|
||||
mySHUOMode(Standard_False),
|
||||
myGDTMode(Standard_True),
|
||||
myMatMode(Standard_True),
|
||||
@@ -770,6 +788,10 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
|
||||
if (GetViewMode())
|
||||
ReadViews(reader.WS(), doc, aLocalFactors);
|
||||
|
||||
// read metadata
|
||||
if (GetMetaMode())
|
||||
ReadMetadata(reader.WS(), doc, aLocalFactors);
|
||||
|
||||
// Expand resulting CAF structure for sub-shapes (optionally with their
|
||||
// names) if requested
|
||||
ExpandSubShapes(STool, ShapePDMap);
|
||||
@@ -1957,7 +1979,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs(const Handle(XSControl_WorkSes
|
||||
//function : GetMassConversionFactor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
|
||||
static Standard_Boolean GetMassConversionFactor(const Handle(StepBasic_NamedUnit)& NU,
|
||||
Standard_Real& afact)
|
||||
{
|
||||
afact = 1.;
|
||||
@@ -1996,7 +2018,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
|
||||
const Standard_Integer aNbNormals = theTriangulatedSufaceSet->NbNormals();
|
||||
// Number of pairs (Point, Normal). It is possible for one point to have multiple normals. This is
|
||||
// useful when the underlying surface is not C1 continuous.
|
||||
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->NbPnindex() : aNodes->Length();
|
||||
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->Pnmax() : aNodes->Length();
|
||||
const Standard_Boolean aHasNormals = aNbNormals > 0;
|
||||
|
||||
// Counting number of triangles in the triangle strips list.
|
||||
@@ -2021,7 +2043,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
|
||||
|
||||
for (Standard_Integer j = 1; j <= aNbPairs; ++j)
|
||||
{
|
||||
const gp_XYZ& aPoint = aNodes->Value(aNbNormals > 1 ? theTriangulatedSufaceSet->PnindexValue(j) : j);
|
||||
const gp_XYZ& aPoint = aNodes->Value((aNbNormals > 1 && theTriangulatedSufaceSet->NbPnindex() > 0) ? theTriangulatedSufaceSet->PnindexValue(j) : j);
|
||||
aMesh->SetNode(j, theFact * aPoint);
|
||||
}
|
||||
|
||||
@@ -2553,11 +2575,36 @@ static Standard_Boolean ReadDatums(const Handle(XCAFDoc_ShapeTool) &STool,
|
||||
const Handle(StepDimTol_GeometricToleranceWithDatumReference)& GTWDR)
|
||||
{
|
||||
if (GTWDR.IsNull()) return Standard_False;
|
||||
Handle(StepDimTol_HArray1OfDatumReference) HADR = GTWDR->DatumSystem();
|
||||
if (HADR.IsNull()) return Standard_False;
|
||||
for (Standard_Integer idr = 1; idr <= HADR->Length(); idr++) {
|
||||
Handle(StepDimTol_DatumReference) DR = HADR->Value(idr);
|
||||
Handle(StepDimTol_Datum) aDatum = DR->ReferencedDatum();
|
||||
Handle(StepDimTol_HArray1OfDatumSystemOrReference) aHADSOR = GTWDR->DatumSystemAP242();
|
||||
if (aHADSOR.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
NCollection_List<Handle(StepDimTol_Datum)> aDatumList;
|
||||
for (Standard_Integer idr = 1; idr <= aHADSOR->Length(); idr++)
|
||||
{
|
||||
const StepDimTol_DatumSystemOrReference aDSOR = aHADSOR->Value(idr);
|
||||
if (aDSOR.IsNull()) continue;
|
||||
Handle(StepDimTol_DatumSystem) aDS = aDSOR.DatumSystem();
|
||||
Handle(StepDimTol_DatumReference) aDR = aDSOR.DatumReference();
|
||||
Handle(StepDimTol_Datum) aDatum;
|
||||
if (!aDS.IsNull())
|
||||
{
|
||||
auto aDatumConList = aDS->Constituents();
|
||||
for (Standard_Integer anInd = 1; anInd <= aDatumConList->Length(); anInd++)
|
||||
{
|
||||
Handle(StepDimTol_DatumReferenceCompartment) aDatRefC = aDatumConList->Value(anInd);
|
||||
aDatumList.Append(aDatRefC->Base().Datum());
|
||||
}
|
||||
}
|
||||
else if (!aDR.IsNull())
|
||||
{
|
||||
aDatumList.Append(aDR->ReferencedDatum());
|
||||
}
|
||||
}
|
||||
for(NCollection_List<Handle(StepDimTol_Datum)>::Iterator anIt(aDatumList); anIt.More(); anIt.Next())
|
||||
{
|
||||
Handle(StepDimTol_Datum) aDatum = anIt.Value();
|
||||
if (aDatum.IsNull()) continue;
|
||||
Interface_EntityIterator subs4 = graph.Sharings(aDatum);
|
||||
for (subs4.Start(); subs4.More(); subs4.Next()) {
|
||||
@@ -5218,6 +5265,26 @@ Standard_Boolean STEPCAFControl_Reader::GetPropsMode() const
|
||||
return myPropsMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMetaMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void STEPCAFControl_Reader::SetMetaMode(const Standard_Boolean theMetaMode)
|
||||
{
|
||||
myMetaMode = theMetaMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetMetaMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean STEPCAFControl_Reader::GetMetaMode() const
|
||||
{
|
||||
return myMetaMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSHUOMode
|
||||
//purpose :
|
||||
@@ -5298,3 +5365,427 @@ Standard_Boolean STEPCAFControl_Reader::GetViewMode() const
|
||||
{
|
||||
return myViewMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadMetadata
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const StepData_Factors& theLocalFactors) const
|
||||
{
|
||||
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
|
||||
const Handle(XSControl_TransferReader)& aTR = theWS->TransferReader();
|
||||
const Handle(Transfer_TransientProcess)& aTP = aTR->TransientProcess();
|
||||
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
|
||||
if (aSTool.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Standard_Integer aNb = aModel->NbEntities();
|
||||
STEPConstruct_Tool aTool(theWS);
|
||||
|
||||
for (Standard_Integer anEntityInd = 1; anEntityInd <= aNb; ++anEntityInd)
|
||||
{
|
||||
Handle(Standard_Transient) anEntity = aModel->Value(anEntityInd);
|
||||
Handle(StepBasic_GeneralProperty) aGeneralProp = Handle(StepBasic_GeneralProperty)::DownCast(anEntity);
|
||||
if (aGeneralProp.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepBasic_GeneralPropertyAssociation) aPropAssociation;
|
||||
NCollection_List< Handle(StepRepr_PropertyDefinition)> aPropDefinitionList;
|
||||
Interface_EntityIterator aSharingListOfGP = theWS->Graph().Sharings(aGeneralProp);
|
||||
for (aSharingListOfGP.Start(); aSharingListOfGP.More(); aSharingListOfGP.Next())
|
||||
{
|
||||
aPropAssociation = Handle(StepBasic_GeneralPropertyAssociation)::DownCast(aSharingListOfGP.Value());
|
||||
if (aPropAssociation.IsNull())
|
||||
continue;
|
||||
|
||||
aPropDefinitionList.Append(aPropAssociation->PropertyDefinition());
|
||||
}
|
||||
|
||||
if (aPropDefinitionList.IsEmpty())
|
||||
continue;
|
||||
|
||||
NCollection_List< Handle(StepRepr_PropertyDefinition)>::Iterator aPropDefIter(aPropDefinitionList);
|
||||
for ( ; aPropDefIter.More(); aPropDefIter.Next())
|
||||
{
|
||||
Handle(StepRepr_PropertyDefinition) aPropDefinition = aPropDefIter.Value();
|
||||
|
||||
// check group of PropertyDefinition
|
||||
NCollection_List<Handle(StepRepr_PropertyDefinition)> aGroupedProperties;
|
||||
Interface_EntityIterator aSharingsListOfPD = theWS->Graph().Sharings(aPropDefinition);
|
||||
for (aSharingsListOfPD.Start(); aSharingsListOfPD.More(); aSharingsListOfPD.Next())
|
||||
{
|
||||
Handle(StepRepr_PropertyDefinitionRelationship) aRel =
|
||||
Handle(StepRepr_PropertyDefinitionRelationship)::DownCast(aSharingsListOfPD.Value());
|
||||
if (aRel.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aGroupedProp = aRel->RelatedPropertyDefinition();
|
||||
if (!aGroupedProp.IsNull())
|
||||
{
|
||||
aGroupedProperties.Append(aGroupedProp);
|
||||
}
|
||||
}
|
||||
|
||||
NCollection_List<Handle(Transfer_Binder)> aBinders;
|
||||
Interface_EntityIterator aSharedListOfPD = theWS->Graph().Shareds(aPropDefinition);
|
||||
for (aSharedListOfPD.Start(); aSharedListOfPD.More(); aSharedListOfPD.Next())
|
||||
{
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
Handle(StepBasic_ProductDefinition) aProductDefinition =
|
||||
Handle(StepBasic_ProductDefinition)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aProductDefinition.IsNull())
|
||||
{
|
||||
aBinder = aTP->Find(aProductDefinition);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape =
|
||||
Handle(StepRepr_ProductDefinitionShape)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aProductDefinitionShape.IsNull())
|
||||
{
|
||||
Handle(StepBasic_ProductDefinition) aProductDef =
|
||||
aProductDefinitionShape->Definition().ProductDefinition();
|
||||
aBinder = aTP->Find(aProductDef);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence) aNextAssembUsOcc =
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aNextAssembUsOcc.IsNull())
|
||||
{
|
||||
aBinder = aTP->Find(aNextAssembUsOcc);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aShapeAspect =
|
||||
Handle(StepRepr_ShapeAspect)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aShapeAspect.IsNull())
|
||||
{
|
||||
TDF_Label aLabel;
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBinder);
|
||||
if (aShape.IsNull())
|
||||
continue;
|
||||
|
||||
if (myMap.IsBound(aShape))
|
||||
{
|
||||
aLabel = myMap.Find(aShape);
|
||||
}
|
||||
}
|
||||
Interface_EntityIterator aSharedListOfSA = theWS->Graph().Sharings(aShapeAspect);
|
||||
for (aSharedListOfSA.Start(); aSharedListOfSA.More(); aSharedListOfSA.Next())
|
||||
{
|
||||
Handle(StepAP242_DraughtingModelItemAssociation) aDMIA =
|
||||
Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aDMIA.IsNull())
|
||||
break;
|
||||
|
||||
Handle(StepAP242_ItemIdentifiedRepresentationUsage) anItemIdentUsage =
|
||||
Handle(StepAP242_ItemIdentifiedRepresentationUsage)::DownCast(aSharedListOfSA.Value());
|
||||
if (!anItemIdentUsage.IsNull())
|
||||
{
|
||||
for (Standard_Integer anIndex = 1; anIndex <= anItemIdentUsage->NbIdentifiedItem(); ++anIndex)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) aReprItem = anItemIdentUsage->IdentifiedItemValue(anIndex);
|
||||
if (aReprItem.IsNull())
|
||||
continue;
|
||||
aBinder = aTP->Find(aReprItem);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aPropDef =
|
||||
Handle(StepRepr_PropertyDefinition)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aPropDef.IsNull() && aPropDef != aPropDefinition)
|
||||
{
|
||||
Interface_EntityIterator aSharingListOfPD = theWS->Graph().Sharings(aPropDef);
|
||||
for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
|
||||
{
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) aShDef =
|
||||
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharingListOfPD.Value());
|
||||
if (aShDef.IsNull())
|
||||
continue;
|
||||
|
||||
findReprItems(theWS, aShDef, aBinders);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) aShapeDefRepr =
|
||||
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aShapeDefRepr.IsNull())
|
||||
{
|
||||
findReprItems(theWS, aShapeDefRepr, aBinders);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aBinders.IsEmpty())
|
||||
continue;
|
||||
|
||||
TDF_LabelSequence aLabelSeq;
|
||||
NCollection_List<Handle(Transfer_Binder)>::Iterator aBindIt(aBinders);
|
||||
for (; aBindIt.More(); aBindIt.Next())
|
||||
{
|
||||
TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBindIt.Value());
|
||||
if (aShape.IsNull())
|
||||
continue;
|
||||
|
||||
TDF_Label aShapeLabel;
|
||||
if (myMap.IsBound(aShape))
|
||||
{
|
||||
aShapeLabel = myMap.Find(aShape);
|
||||
}
|
||||
if (!aShapeLabel.IsNull())
|
||||
{
|
||||
aLabelSeq.Append(aShapeLabel);
|
||||
}
|
||||
}
|
||||
|
||||
//create metadata
|
||||
for (TDF_LabelSequence::Iterator aLabelIt(aLabelSeq); aLabelIt.More(); aLabelIt.Next())
|
||||
{
|
||||
TDF_Label aLabel = aLabelIt.Value();
|
||||
Handle(TDataStd_NamedData) anAttr;
|
||||
if (!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAttr))
|
||||
{
|
||||
anAttr = new TDataStd_NamedData;
|
||||
aLabel.AddAttribute(anAttr);
|
||||
}
|
||||
|
||||
fillAttributes(theWS, aPropDefinition, theLocalFactors, anAttr);
|
||||
if (!aGroupedProperties.IsEmpty())
|
||||
{
|
||||
NCollection_List<Handle(StepRepr_PropertyDefinition)>::Iterator aPropIt(aGroupedProperties);
|
||||
for ( ; aPropIt.More(); aPropIt.Next())
|
||||
{
|
||||
fillAttributes(theWS, aPropIt.Value(), theLocalFactors, anAttr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : findReprItems
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::findReprItems(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepShape_ShapeDefinitionRepresentation)& theShDefRepr,
|
||||
NCollection_List<Handle(Transfer_Binder)>& theBinders) const
|
||||
{
|
||||
Handle(StepRepr_Representation) aRepr = theShDefRepr->UsedRepresentation();
|
||||
if (aRepr.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
const Handle(Transfer_TransientProcess)& aTP = theWS->TransferReader()->TransientProcess();
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = aRepr->Items();
|
||||
if (!aReprItems->IsEmpty())
|
||||
{
|
||||
for (Standard_Integer anInd = aReprItems->Lower(); anInd <= aReprItems->Upper(); anInd++)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) aReprItem = aReprItems->Value(anInd);
|
||||
aBinder = aTP->Find(aReprItem);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
theBinders.Append(aBinder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : fillAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::fillAttributes(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepRepr_PropertyDefinition)& thePropDef,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
Handle(TDataStd_NamedData)& theAttr) const
|
||||
{
|
||||
// skip if key is null
|
||||
if (thePropDef->Name().IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinitionRepresentation) aPropDefRepr;
|
||||
Interface_EntityIterator aSharingListOfPD = theWS->Graph().Sharings(thePropDef);
|
||||
for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
|
||||
{
|
||||
aPropDefRepr = Handle(StepRepr_PropertyDefinitionRepresentation)::DownCast(aSharingListOfPD.Value());
|
||||
if (aPropDefRepr.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepRepr_Representation) aUsedRepr = aPropDefRepr->UsedRepresentation();
|
||||
if (aUsedRepr.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = aUsedRepr->Items();
|
||||
if (!aReprItems.IsNull())
|
||||
{
|
||||
for (Standard_Integer anIndex = aReprItems->Lower(); anIndex <= aReprItems->Upper(); anIndex++)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) anItem = aReprItems->Value(anIndex);
|
||||
if (anItem.IsNull())
|
||||
continue;
|
||||
|
||||
if (anItem->IsKind(STANDARD_TYPE(StepRepr_DescriptiveRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_DescriptiveRepresentationItem) aDescrItem = Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(anItem);
|
||||
Handle(TCollection_HAsciiString) aDescription = aDescrItem->Description();
|
||||
theAttr->SetString(thePropDef->Name()->ToCString(), aDescription->ToCString());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_MeasureRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_MeasureRepresentationItem) aMeasureItem = Handle(StepRepr_MeasureRepresentationItem)::DownCast(anItem);
|
||||
Standard_Real aValue = aMeasureItem->Measure()->ValueComponent();
|
||||
TCollection_AsciiString aValType = aMeasureItem->Measure()->ValueComponentMember()->Name();
|
||||
StepBasic_Unit anUnit = aMeasureItem->Measure()->UnitComponent();
|
||||
if (!anUnit.IsNull())
|
||||
{
|
||||
Standard_Real aParam = 1.;
|
||||
if (anUnit.Type() == STANDARD_TYPE(StepBasic_DerivedUnit))
|
||||
{
|
||||
Handle(StepBasic_DerivedUnit) aDUnit = anUnit.DerivedUnit();
|
||||
for (Standard_Integer anInd = 1; anInd <= aDUnit->NbElements(); ++anInd)
|
||||
{
|
||||
Handle(StepBasic_DerivedUnitElement) aDUElem = aDUnit->ElementsValue(anInd);
|
||||
Standard_Real anExp = aDUElem->Exponent();
|
||||
Handle(StepBasic_NamedUnit) aNUnit = aDUElem->Unit();
|
||||
if (!aNUnit.IsNull())
|
||||
{
|
||||
if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndLengthUnit)) ||
|
||||
aNUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit)))
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (aValType == "VOLUME_MEASURE")
|
||||
{
|
||||
aParam = pow(theLocalFactors.LengthFactor(), anExp);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParam = aParam / pow(theLocalFactors.LengthFactor(), anExp);
|
||||
}
|
||||
}
|
||||
else if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit))) {
|
||||
Standard_Real aFact = 1.;
|
||||
if (GetMassConversionFactor(aNUnit, aFact))
|
||||
{
|
||||
aParam = aParam * aFact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (anUnitCtx.AreaDone())
|
||||
aParam = anUnitCtx.AreaFactor();
|
||||
if (anUnitCtx.LengthDone())
|
||||
{
|
||||
Standard_Real aLengthFactor = anUnitCtx.LengthFactor();
|
||||
aParam *= pow(aLengthFactor, anExp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
aValue = aValue * aParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(StepBasic_NamedUnit) aNUnit = anUnit.NamedUnit();
|
||||
if (!aNUnit.IsNull())
|
||||
{
|
||||
if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit)))
|
||||
{
|
||||
Standard_Real aFact = 1.;
|
||||
if (GetMassConversionFactor(aNUnit, aFact))
|
||||
{
|
||||
aValue *= aFact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (anUnitCtx.AreaDone())
|
||||
aParam = anUnitCtx.AreaFactor();
|
||||
if (anUnitCtx.VolumeDone())
|
||||
aParam = anUnitCtx.VolumeFactor();
|
||||
if (anUnitCtx.LengthDone())
|
||||
aParam = anUnitCtx.LengthFactor();
|
||||
|
||||
aValue *= aParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aValue);
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_ValueRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_ValueRepresentationItem) aValueItem = Handle(StepRepr_ValueRepresentationItem)::DownCast(anItem);
|
||||
Handle(StepBasic_MeasureValueMember) aMeasureValueMem = aValueItem->ValueComponentMember();
|
||||
Interface_ParamType aParamType = aMeasureValueMem->ParamType();
|
||||
if (aParamType == Interface_ParamInteger)
|
||||
{
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), aMeasureValueMem->Integer());
|
||||
}
|
||||
else if (aParamType == Interface_ParamReal)
|
||||
{
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aMeasureValueMem->Real());
|
||||
}
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_IntegerRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_IntegerRepresentationItem) anIntegerItem = Handle(StepRepr_IntegerRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), anIntegerItem->Value());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_RealRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_RealRepresentationItem) aRealItem = Handle(StepRepr_RealRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aRealItem->Value());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_BooleanRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_BooleanRepresentationItem) aBoolItem = Handle(StepRepr_BooleanRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), aBoolItem->Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define _STEPCAFControl_Reader_HeaderFile
|
||||
|
||||
#include <STEPControl_Reader.hxx>
|
||||
#include <StepData_Factors.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
@@ -28,18 +29,21 @@
|
||||
#include <XCAFDimTolObjects_DatumModifWithValue.hxx>
|
||||
|
||||
class XSControl_WorkSession;
|
||||
class TDataStd_NamedData;
|
||||
class TDocStd_Document;
|
||||
class STEPCAFControl_ExternFile;
|
||||
class TopoDS_Shape;
|
||||
class XCAFDoc_ShapeTool;
|
||||
class StepRepr_RepresentationItem;
|
||||
class Transfer_TransientProcess;
|
||||
class StepBasic_NamedUnit;
|
||||
class StepShape_ConnectedFaceSet;
|
||||
class StepShape_ShapeDefinitionRepresentation;
|
||||
class StepRepr_NextAssemblyUsageOccurrence;
|
||||
class StepRepr_PropertyDefinition;
|
||||
class STEPConstruct_Tool;
|
||||
class StepDimTol_Datum;
|
||||
class StepData_Factors;
|
||||
|
||||
class Transfer_Binder;
|
||||
|
||||
//! Provides a tool to read STEP file and put it into
|
||||
//! DECAF document. Besides transfer of shapes (including
|
||||
@@ -176,6 +180,11 @@ public:
|
||||
Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetPropsMode() const;
|
||||
|
||||
//! MetaMode for indicate read Metadata or not.
|
||||
Standard_EXPORT void SetMetaMode(const Standard_Boolean theMetaMode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetMetaMode() const;
|
||||
|
||||
//! Set SHUO mode for indicate write SHUO or not.
|
||||
Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
|
||||
@@ -234,7 +243,7 @@ protected:
|
||||
Standard_EXPORT Standard_Boolean ReadColors
|
||||
(const Handle(XSControl_WorkSession)& WS,
|
||||
const Handle(TDocStd_Document)& doc,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads names of parts defined in the STEP model and
|
||||
//! assigns them to corresponding labels in the DECAF document
|
||||
@@ -246,7 +255,13 @@ protected:
|
||||
Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS,
|
||||
const Handle(TDocStd_Document)& doc,
|
||||
const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads metadata assigned to shapes in the STEP model and
|
||||
//! assigns them to corresponding labels in the DECAF document
|
||||
Standard_EXPORT Standard_Boolean ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads layers of parts defined in the STEP model and
|
||||
//! set reference between shape and layers in the DECAF document
|
||||
@@ -260,19 +275,19 @@ protected:
|
||||
//! set reference between shape instances from different assemblyes
|
||||
Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS,
|
||||
const Handle(TDocStd_Document)& doc,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
//! Reads materials for instances defined in the STEP model and
|
||||
//! set reference between shape instances from different assemblyes
|
||||
Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS,
|
||||
const Handle(TDocStd_Document)& doc,
|
||||
const Handle(TColStd_HSequenceOfTransient)& SeqPDS,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads Views for instances defined in the STEP model
|
||||
Standard_EXPORT Standard_Boolean ReadViews(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Populates the sub-Label of the passed TDF Label with shape
|
||||
//! data associated with the given STEP Representation Item,
|
||||
@@ -314,26 +329,37 @@ private:
|
||||
const Standard_Real theModifValue,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const Handle(XSControl_WorkSession)& theWS,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
//! Internal method. Read Datums, connected to GeomTolerance theGDTL.
|
||||
Standard_Boolean readDatumsAP242(const Handle(Standard_Transient)& theEnt,
|
||||
const TDF_Label theGDTL,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const Handle(XSControl_WorkSession)& theWS,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
//! Internal method. Read Dimension or GeomTolerance.
|
||||
TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const Handle(XSControl_WorkSession)& theWS,
|
||||
const StepData_Factors& theLocalFactors);
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
//! Prepares units for transfer
|
||||
void prepareUnits(const Handle(StepData_StepModel)& theModel,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
StepData_Factors& theLocalFactors) const;
|
||||
|
||||
//! Find RepresentationItems
|
||||
Standard_Boolean findReprItems(const Handle(XSControl_WorkSession) & theWS,
|
||||
const Handle(StepShape_ShapeDefinitionRepresentation) & theShDefRepr,
|
||||
NCollection_List<Handle(Transfer_Binder)>& theBinders) const;
|
||||
|
||||
//! Fill metadata
|
||||
Standard_Boolean fillAttributes(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepRepr_PropertyDefinition)& thePropDef,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
Handle(TDataStd_NamedData)& theAttr) const;
|
||||
|
||||
private:
|
||||
|
||||
STEPControl_Reader myReader;
|
||||
@@ -343,6 +369,7 @@ private:
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
Standard_Boolean myPropsMode;
|
||||
Standard_Boolean myMetaMode;
|
||||
Standard_Boolean mySHUOMode;
|
||||
Standard_Boolean myGDTMode;
|
||||
Standard_Boolean myMatMode;
|
||||
|
@@ -983,7 +983,7 @@ static Standard_Integer FindEntities(const Handle(Transfer_FinderProcess)& theFP
|
||||
//Handle(Transfer_TransientListBinder)::DownCast( bnd->Next(Standard_True) );
|
||||
Handle(Transfer_TransientListBinder)::DownCast(aBinder);
|
||||
Standard_Integer aResCount = 0;
|
||||
if (aTransientListBinder.IsNull() && theShape.ShapeType() == TopAbs_COMPOUND)
|
||||
if (aTransientListBinder.IsNull())
|
||||
{
|
||||
for (TopoDS_Iterator anIter(theShape); anIter.More(); anIter.Next())
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user