1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
dpasukhi
c975787c6c 0033404: Configuration - Building with Cotire failed on Clang-15
Replaced old including of int defs from C standard into C++(11+) standard
2023-06-06 13:21:50 +00:00
208 changed files with 1433 additions and 3766 deletions

View File

@@ -725,7 +725,7 @@ Another possible problem is the order of initialization of global variables defi
Avoid explicit usage of basic types (*int*, *float*, *double*, etc.), use Open CASCADE Technology types from package *Standard: Standard_Integer, Standard_Real, Standard_ShortReal, Standard_Boolean, Standard_CString* and others or a specific *typedef* instead.
### Use sizeof() to calculate sizes [MANDATORY]
### Use *sizeof()* to calculate sizes [MANDATORY]
Do not assume sizes of types. Use *sizeof()* instead to calculate sizes.
@@ -738,7 +738,7 @@ It is recommended to follow this rule for any plain text files for consistency a
The rules listed in this chapter are important for stability of the programs that use Open CASCADE Technology libraries.
### Use OSD::SetSignal() to catch exceptions
### Use *OSD::SetSignal()* to catch exceptions
When using Open CASCADE Technology in an application, call *OSD::SetSignal()* function when the application is initialized.
@@ -787,7 +787,7 @@ See the following example:
In C++ use *new* and *delete* operators instead of *malloc()* and *free()*. Try not to mix different memory allocation techniques.
### Match new and delete [MANDATORY]
### Match *new* and *delete* [MANDATORY]
Use the same form of new and delete.
@@ -812,7 +812,7 @@ Standard_Integer aTmpVar2 = 0; // OK
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is guaranteed by subsequent code.
### Do not hide global new
### Do not hide global *new*
Avoid hiding the global *new* operator.

View File

@@ -780,7 +780,7 @@ restore theBox
@subsubsection occt_draw_3_3_1 set
#### In DrawTrSurf package:
#### In *DrawTrSurf* package:
~~~~{.php}
void Set(Standard_CString& Name,const gp_Pnt& G) ;
@@ -797,7 +797,7 @@ void Set(Standard_CString& Name,
const Handle(Poly_Polygon2D)& P) ;
~~~~
#### In DBRep package:
#### In *DBRep* package:
~~~~{.php}
void Set(const Standard_CString Name,
@@ -822,13 +822,13 @@ DBRep::Set(char*,B);
@subsubsection occt_draw_3_3_2 get
#### In DrawTrSurf package:
#### In *DrawTrSurf* package:
~~~~{.php}
Handle_Geom_Geometry Get(Standard_CString& Name) ;
~~~~
#### In DBRep package:
#### In *DBRep* package:
~~~~{.php}
TopoDS_Shape Get(Standard_CString& Name,

View File

@@ -398,25 +398,17 @@ void AIS_Manipulator::Attach (const Handle(AIS_ManipulatorObjectSequence)& theOb
const Handle(AIS_InteractiveContext)& aContext = Object()->GetContext();
if (!aContext.IsNull())
{
if (!aCurObject.IsNull())
if (!aContext->IsDisplayed (this))
{
Handle(Graphic3d_TransformPers) aTransPers = aCurObject->TransformPersistence();
if (!aTransPers.IsNull())
{
aCurObject->TransformPersistence()->SetAnchorPoint(myPosition.Location());
}
}
if (!aContext->IsDisplayed(this))
{
aContext->Display(this, Standard_False);
aContext->Display (this, Standard_False);
}
else
{
aContext->Update(this, Standard_False);
aContext->RecomputeSelectionOnly(this);
aContext->Update (this, Standard_False);
aContext->RecomputeSelectionOnly (this);
}
aContext->Load(this);
aContext->Load (this);
}
if (theOptions.EnableModes)
@@ -758,11 +750,6 @@ void AIS_Manipulator::Transform (const gp_Trsf& theTrsf)
{
anObj->SetLocalTransformation (theTrsf * anOldTrsf);
}
Handle(Graphic3d_TransformPers) aTransPers = anObj->TransformPersistence();
if (!aTransPers.IsNull())
{
anObj->TransformPersistence()->SetAnchorPoint(myPosition.Location());
}
}
}
@@ -819,32 +806,15 @@ void AIS_Manipulator::updateTransformation()
{
gp_Trsf aTrsf;
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
Handle(AIS_InteractiveObject) anObj = Object();
for (AIS_ManipulatorObjectSequence::Iterator anObjIter(*anObjects); anObjIter.More(); anObjIter.Next())
if (!myIsZoomPersistentMode)
{
anObj = anObjIter.Value();
aTrsf.SetTransformation (myPosition, gp::XOY());
}
if (!anObj.IsNull())
else
{
Handle(Graphic3d_TransformPers) aTransPers = anObj->TransformPersistence();
if (!aTransPers.IsNull())
{
aTrsf.SetTransformation(myPosition, gp::XOY());
}
else
{
if (!myIsZoomPersistentMode)
{
aTrsf.SetTransformation(myPosition, gp::XOY());
}
else
{
const gp_Dir& aVDir = myPosition.Direction();
const gp_Dir& aXDir = myPosition.XDirection();
aTrsf.SetTransformation(gp_Ax2(gp::Origin(), aVDir, aXDir), gp::XOY());
}
}
const gp_Dir& aVDir = myPosition.Direction();
const gp_Dir& aXDir = myPosition.XDirection();
aTrsf.SetTransformation (gp_Ax2 (gp::Origin(), aVDir, aXDir), gp::XOY());
}
Handle(TopLoc_Datum3D) aGeomTrsf = new TopLoc_Datum3D (aTrsf);

View File

@@ -1047,13 +1047,11 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
: 0.0;
if (double (Abs (aDelta.x())) > aZoomTol)
{
UpdateZoom (Aspect_ScrollDelta (aDelta.x()));
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
if (UpdateZoom (Aspect_ScrollDelta (aDelta.x())))
{
toUpdateView = true;
}
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
}
@@ -1077,6 +1075,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
}
aDelta.y() = -aDelta.y();
myMouseProgressPoint = thePoint;
if (myUI.Panning.ToPan)
{
myUI.Panning.Delta += aDelta;
@@ -1086,12 +1085,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myUI.Panning.ToPan = true;
myUI.Panning.Delta = aDelta;
}
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
@@ -3060,8 +3053,6 @@ void AIS_ViewController::handleDynamicHighlight (const Handle(AIS_InteractiveCon
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;
myGL.Panning .ToPan = false;
myGL.ZoomActions.Clear();
}
}
}

View File

@@ -1177,45 +1177,6 @@ void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges (const Message_ProgressR
UpdateIntersectedEdges (aLA, aGFE);
}
namespace
{
//=======================================================================
//function : CheckConnectionsOfFace
//purpose : Checks number of connections for theFace with theLF
// Returns true if number of connections more than 1
//=======================================================================
static Standard_Boolean checkConnectionsOfFace(const TopoDS_Shape& theFace,
const TopTools_ListOfShape& theLF)
{
TopTools_IndexedMapOfShape aShapeVert;
for (TopTools_ListOfShape::Iterator aFImIterator(theLF); aFImIterator.More(); aFImIterator.Next())
{
const TopoDS_Shape& aShape = aFImIterator.Value();
if (aShape.IsSame(theFace))
{
continue;
}
TopExp::MapShapes(aShape, TopAbs_VERTEX, aShapeVert);
}
Standard_Integer aNbConnections = 0;
TopTools_IndexedMapOfShape aFaceVertices;
TopExp::MapShapes(theFace, TopAbs_VERTEX, aFaceVertices);
for (TopTools_IndexedMapOfShape::Iterator aVertIter(aFaceVertices); aVertIter.More(); aVertIter.Next())
{
const TopoDS_Shape& aVert = aVertIter.Value();
if (aShapeVert.Contains(aVert))
{
++aNbConnections;
}
if (aNbConnections > 1)
{
return Standard_True;
}
}
return Standard_False;
}
}
//=======================================================================
//function : BuildSplitsOfFaces
//purpose : Building the splits of offset faces and
@@ -1307,10 +1268,6 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
for (TopTools_ListIteratorOfListOfShape aItLFIm (aLFImages1); aItLFIm.More();)
{
Standard_Boolean bAllInv = Standard_True;
// Additional check for artificial case
// if current image face consist only of edges from aMapEInv and aMENInv
// then recheck current face for the futher processing
Standard_Boolean aToReCheckFace = bArtificialCase;
const TopoDS_Shape& aFIm = aItLFIm.Value();
TopExp_Explorer aExpE (aFIm, TopAbs_EDGE);
for (; aExpE.More(); aExpE.Next())
@@ -1321,19 +1278,12 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
bAllInv = Standard_False;
if (!aMENInv.Contains (aE))
{
aToReCheckFace = Standard_False;
break;
}
}
}
// if current image face is to recheck then check number of connections for this face
// with other image faces for current face
if (!aExpE.More() && aToReCheckFace)
{
aToReCheckFace = checkConnectionsOfFace(aFIm, aLFImages1);
}
// do not delete image face from futher processing if aToReCheckFace is true
if (!aExpE.More() && !aToReCheckFace)
//
if (!aExpE.More())
{
if (bAllInv)
{

View File

@@ -1292,10 +1292,6 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S)
for (; itl.More(); itl.Next())
{
Standard_Integer IndOfFace = itl.Value();
if (AllFaces.Size() < IndOfFace)
{
continue;
}
myGenerated.Append(AllFaces(IndOfFace));
}
@@ -1306,10 +1302,6 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S)
{
Standard_Integer IndOfFace = itl.Value();
IndOfFace += (i-1)*myNbEdgesInSection;
if (AllFaces.Size() < IndOfFace)
{
continue;
}
myGenerated.Append(AllFaces(IndOfFace));
}
}

View File

@@ -308,15 +308,10 @@ Standard_Boolean BRepTools_GTrsfModification::NewTriangulation(const TopoDS_Face
// modify normals
if (theTriangulation->HasNormals())
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
{
gp_Dir aNormal = theTriangulation->Normal(anInd);
gp_Mat aMat = aGTrsf.VectorialPart();
aMat.SetDiagonal(1., 1., 1.);
gp_Trsf aTrsf;
aTrsf.SetForm(gp_Rotation);
(gp_Mat&)aTrsf.HVectorialPart() = aMat;
aNormal.Transform(aTrsf);
aNormal.Transform(aGTrsf.Trsf());
theTriangulation->SetNormal(anInd, aNormal);
}
}

View File

@@ -126,68 +126,23 @@ static void readColor (const BinObjMgt_Persistent& theSource,
static void writeTexture (BinObjMgt_Persistent& theTarget,
const Handle(Image_Texture)& theImage)
{
if (theImage.IsNull())
{
theTarget.PutAsciiString("");
return;
}
if (theImage->DataBuffer().IsNull())
{
theTarget.PutAsciiString(theImage->FilePath());
theTarget.PutBoolean(false);
if (theImage->FileOffset() == -1 || theImage->FileLength() == -1)
{
theTarget.PutBoolean(true);
return;
}
theTarget.PutBoolean(false);
theTarget.PutInteger(static_cast<int>(theImage->FileOffset()));
theTarget.PutInteger(static_cast<int>(theImage->FileLength()));
return;
}
theTarget.PutAsciiString(theImage->TextureId());
theTarget.PutBoolean(true);
theTarget.PutInteger(static_cast<int>(theImage->DataBuffer()->Size()));
theTarget.PutByteArray((Standard_Byte*)theImage->DataBuffer()->Data(),
static_cast<int>(theImage->DataBuffer()->Size()));
theTarget.PutAsciiString (!theImage.IsNull()
&& !theImage->FilePath().IsEmpty()
&& theImage->FileOffset() == -1
? theImage->FilePath()
: "");
}
//! Decode texture path.
static void readTexture (const BinObjMgt_Persistent& theSource,
Handle(Image_Texture)& theTexture)
{
TCollection_AsciiString aStr;
theSource.GetAsciiString(aStr);
if (aStr.IsEmpty())
TCollection_AsciiString aPath;
theSource.GetAsciiString (aPath);
if (!aPath.IsEmpty())
{
return;
theTexture = new Image_Texture (aPath);
}
Standard_Boolean anUseBuffer;
if (!theSource.GetBoolean(anUseBuffer).IsOK())
{
theTexture = new Image_Texture(aStr);
return;
}
Standard_Integer anOffset = -1, aLength = -1;
if (!anUseBuffer)
{
Standard_Boolean isOnlyFilePath;
theSource.GetBoolean(isOnlyFilePath);
if (isOnlyFilePath)
{
theTexture = new Image_Texture(aStr);
return;
}
theSource.GetInteger(anOffset);
theSource.GetInteger(aLength);
theTexture = new Image_Texture(aStr, anOffset, aLength);
return;
}
theSource.GetInteger(aLength);
Handle(NCollection_Buffer) aBuff =
new NCollection_Buffer(NCollection_BaseAllocator::CommonBaseAllocator(), aLength);
theSource.GetByteArray(aBuff->ChangeData(), aLength);
theTexture = new Image_Texture(aBuff, aStr);
}
//=======================================================================

View File

@@ -597,7 +597,7 @@ TopoDS_Edge ChFi2d_FilletAlgo::Result(const gp_Pnt& thePoint, TopoDS_Edge& theEd
gp_Vec aCircleDir;
aCircle->D1(aParam1, aPoint1, aCircleDir);
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ? !aIsOut : aIsOut)
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ aIsOut)
aStart = aNearest->getParam();
else
anEnd = aNearest->getParam();
@@ -619,7 +619,7 @@ TopoDS_Edge ChFi2d_FilletAlgo::Result(const gp_Pnt& thePoint, TopoDS_Edge& theEd
aCircle->D1(aParam2, aPoint2, aCircleDir);
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ? aIsOut : !aIsOut)
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ (!aIsOut))
aStart = aNearest->getParam2();
else
anEnd = aNearest->getParam2();

View File

@@ -1236,11 +1236,8 @@ void ComputeInternalPoints
// std::cout << "Changement de signe detecte" << std::endl;
solution = Standard_False;
while (!solution) {
// Selecting the middle point between XInf and XSup leads situation, where X values almost do not change.
// To prevent this situation, select shifted point instead of middle.
const Standard_Real aCoef = 2. / 3.;
X(1) = XInf(1) + aCoef * (XSup(1) - XInf(1));
X(2) = XInf(2) + aCoef * (XSup(2) - XInf(2));
X(1) = (XInf(1) + XSup(1)) /2.;
X(2) = (XInf(2) + XSup(2)) /2.;
rsnld.Perform(SFunc,X,infb,supb);
if (!rsnld.IsDone()) {

View File

@@ -538,6 +538,7 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
{
theProvider = aNode->BuildProvider();
aNode->GlobalParameters = GlobalParameters;
theProvider->SetNode(aNode);
return Standard_True;
}
}

View File

@@ -125,7 +125,7 @@ Handle(DE_ConfigurationNode) DEXCAFCascade_ConfigurationNode::Copy() const
//=======================================================================
Handle(DE_Provider) DEXCAFCascade_ConfigurationNode::BuildProvider()
{
return new DEXCAFCascade_Provider (this);
return new DEXCAFCascade_Provider();
}
//=======================================================================

View File

@@ -86,9 +86,7 @@ int ec_error ( const std::string& s, const std::string& text )
%top{
// Pre-include stdlib.h to avoid redefinition of integer type macros (INT8_MIN and similar in generated code)
#if !defined(_MSC_VER) || (_MSC_VER >= 1600) // Visual Studio 2010+
#include "stdint.h"
#endif
#include <Standard_TypeDef.hxx>
}
%{

View File

@@ -1,7 +1,5 @@
// Pre-include stdlib.h to avoid redefinition of integer type macros (INT8_MIN and similar in generated code)
#if !defined(_MSC_VER) || (_MSC_VER >= 1600) // Visual Studio 2010+
#include "stdint.h"
#endif
#include <Standard_TypeDef.hxx>
#define YY_INT_ALIGNED short int

View File

@@ -609,7 +609,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path,
myAdpSection.LastParameter(),
Path->Resolution(Tol/100),
myAdpSection.Resolution(Tol/100));
if (Ext.IsDone() && !Ext.IsParallel()) {
if (Ext.IsDone()) {
Extrema_POnCurv P1, P2;
for (ii=1; ii<=Ext.NbExt(); ii++) {
distaux = sqrt (Ext.SquareDistance(ii));

View File

@@ -23,7 +23,6 @@
#include <gp_Ax1.hxx>
#include <gp_Ax2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis1Placement.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Direction.hxx>
@@ -32,9 +31,7 @@
//=============================================================================
// Creation d' un axis1_placement de prostep a partir d' un Ax1 de gp
//=============================================================================
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
( const gp_Ax1& A,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A)
{
#include "GeomToStep_MakeAxis1Placement_gen.pxx"
}
@@ -42,9 +39,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
// Creation d' un axis1_placement de prostep a partir d' un Ax2d de gp
//=============================================================================
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
( const gp_Ax2d& A,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A)
{
#include "GeomToStep_MakeAxis1Placement_gen.pxx"
}
@@ -55,8 +50,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
//=============================================================================
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
( const Handle(Geom_Axis1Placement)& Axis1,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_Axis1Placement)& Axis1)
{
gp_Ax1 A;
A = Axis1->Ax1();
@@ -69,8 +63,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
//=============================================================================
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
( const Handle(Geom2d_AxisPlacement)& Axis1,
const StepData_Factors& theLocalFactors)
( const Handle(Geom2d_AxisPlacement)& Axis1)
{
gp_Ax2d A;
A = Axis1->Ax2d();

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Axis1Placement;
class gp_Ax1;
class gp_Ax2d;
@@ -42,17 +40,13 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A);
Standard_EXPORT const Handle(StepGeom_Axis1Placement)& Value() const;

View File

@@ -18,7 +18,7 @@ Handle(StepGeom_Axis1Placement) Axe = new StepGeom_Axis1Placement;
Handle(StepGeom_CartesianPoint) P;
Handle(StepGeom_Direction) D;
GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
GeomToStep_MakeDirection MkDir(A.Direction());
P = MkPoint.Value();

View File

@@ -21,7 +21,6 @@
#include <gp_Ax2.hxx>
#include <gp_Ax22d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Direction.hxx>
@@ -31,14 +30,13 @@
// Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp
//=============================================================================
GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
( const gp_Ax2& A,
const StepData_Factors& theLocalFactors)
( const gp_Ax2& A)
{
Handle(StepGeom_Axis2Placement2d) Axe;
Handle(StepGeom_CartesianPoint) P;
Handle(StepGeom_Direction) D;
GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
GeomToStep_MakeDirection MkDir(A.Direction());
P = MkPoint.Value();
@@ -58,14 +56,13 @@ GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
//=============================================================================
GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
( const gp_Ax22d& A,
const StepData_Factors& theLocalFactors)
( const gp_Ax22d& A)
{
Handle(StepGeom_Axis2Placement2d) Axe;
Handle(StepGeom_CartesianPoint) P;
Handle(StepGeom_Direction) D1;
GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
GeomToStep_MakeDirection MkDir(A.XDirection());
P = MkPoint.Value();

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Axis2Placement2d;
class gp_Ax2;
class gp_Ax22d;
@@ -40,11 +38,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A);
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A);
Standard_EXPORT const Handle(StepGeom_Axis2Placement2d)& Value() const;

View File

@@ -22,20 +22,19 @@
#include <gp_Ax3.hxx>
#include <gp_Trsf.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Direction.hxx>
#include <TCollection_HAsciiString.hxx>
static Handle(StepGeom_Axis2Placement3d) MakeAxis2Placement3d
(const gp_Pnt& O, const gp_Dir& D, const gp_Dir& X, const Standard_CString nom, Standard_Real aFactor)
(const gp_Pnt& O, const gp_Dir& D, const gp_Dir& X, const Standard_CString nom)
{
Handle(StepGeom_Axis2Placement3d) Axe;
Handle(StepGeom_CartesianPoint) P;
Handle(StepGeom_Direction) D1, D2;
GeomToStep_MakeCartesianPoint MkPoint(O, aFactor);
GeomToStep_MakeCartesianPoint MkPoint(O);
GeomToStep_MakeDirection MkDir1(D);
GeomToStep_MakeDirection MkDir2(X);
@@ -56,14 +55,13 @@ static Handle(StepGeom_Axis2Placement3d) MakeAxis2Placement3d
// Creation d' un axis2_placement_3d a l origine
//=============================================================================
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d (
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( )
{
gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
// le reste inchange
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
(A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
(A.Location(), A.Direction(), A.XDirection(), "");
theAxis2Placement3d = Axe;
done = Standard_True;
}
@@ -72,12 +70,11 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d (
// Creation d' un axis2_placement_3d de prostep a partir d' un Ax2 de gp
//=============================================================================
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
const gp_Ax2& A,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2&
A)
{
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
(A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
(A.Location(), A.Direction(), A.XDirection(), "");
theAxis2Placement3d = Axe;
done = Standard_True;
}
@@ -86,12 +83,11 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
// Creation d' un axis2_placement_3d de prostep a partir d' un Ax3 de gp
//=============================================================================
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
const gp_Ax3& A,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
( const gp_Ax3& A)
{
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
(A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
(A.Location(), A.Direction(), A.XDirection(), "");
theAxis2Placement3d = Axe;
done = Standard_True;
}
@@ -100,16 +96,15 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
// Creation d' un axis2_placement_3d de prostep a partir d' un Trsf de gp
//=============================================================================
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
const gp_Trsf& T,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
( const gp_Trsf& T)
{
gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
A.Transform (T);
// le reste inchange
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
(A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
(A.Location(), A.Direction(), A.XDirection(), "");
theAxis2Placement3d = Axe;
done = Standard_True;
}
@@ -119,15 +114,14 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
// de Geom
//=============================================================================
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
const Handle(Geom_Axis2Placement)& Axis2,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
( const Handle(Geom_Axis2Placement)& Axis2)
{
gp_Ax2 A;
A = Axis2->Ax2();
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
(A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
(A.Location(), A.Direction(), A.XDirection(), "");
theAxis2Placement3d = Axe;
done = Standard_True;
}

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
#include <StepData_StepModel.hxx>
class StepData_Factors;
class StepGeom_Axis2Placement3d;
class gp_Ax2;
class gp_Ax3;
@@ -42,19 +40,15 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d();
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A);
Standard_EXPORT const Handle(StepGeom_Axis2Placement3d)& Value() const;

View File

@@ -21,7 +21,6 @@
#include <GeomToStep_MakeBSplineCurveWithKnots.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_HArray1OfCartesianPoint.hxx>
@@ -36,9 +35,10 @@
// Creation d' une bspline_curve_with_knots de
// prostep a partir d' une BSplineCurve de Geom
//=============================================================================
GeomToStep_MakeBSplineCurveWithKnots::GeomToStep_MakeBSplineCurveWithKnots
( const Handle(Geom_BSplineCurve)& BS,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeBSplineCurveWithKnots::
GeomToStep_MakeBSplineCurveWithKnots( const
Handle(Geom_BSplineCurve)& BS )
{
#define Array1OfPnt_gen TColgp_Array1OfPnt
#include "GeomToStep_MakeBSplineCurveWithKnots_gen.pxx"
@@ -49,9 +49,10 @@ GeomToStep_MakeBSplineCurveWithKnots::GeomToStep_MakeBSplineCurveWithKnots
// prostep a partir d' une BSplineCurve de Geom2d
//=============================================================================
GeomToStep_MakeBSplineCurveWithKnots::GeomToStep_MakeBSplineCurveWithKnots
( const Handle(Geom2d_BSplineCurve)& BS,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeBSplineCurveWithKnots::
GeomToStep_MakeBSplineCurveWithKnots( const
Handle(Geom2d_BSplineCurve)& BS )
{
#define Array1OfPnt_gen TColgp_Array1OfPnt2d
#include "GeomToStep_MakeBSplineCurveWithKnots_gen.pxx"

View File

@@ -22,10 +22,9 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepGeom_BSplineCurveWithKnots;
class Geom_BSplineCurve;
class Geom2d_BSplineCurve;
class StepData_Factors;
class StepGeom_BSplineCurveWithKnots;
//! This class implements the mapping between classes
@@ -40,11 +39,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin);
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnots)& Value() const;

View File

@@ -21,7 +21,6 @@
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_HArray1OfCartesianPoint.hxx>
@@ -38,7 +37,8 @@
//=============================================================================
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
Handle(Geom_BSplineCurve)& BS, const StepData_Factors& theLocalFactors)
Handle(Geom_BSplineCurve)& BS )
{
#define Array1OfPnt_gen TColgp_Array1OfPnt
#include "GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx"
@@ -51,7 +51,7 @@ GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
Handle(Geom2d_BSplineCurve)& BS, const StepData_Factors& theLocalFactors)
Handle(Geom2d_BSplineCurve)& BS )
{
#define Array1OfPnt_gen TColgp_Array1OfPnt2d

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
class Geom_BSplineCurve;
class Geom2d_BSplineCurve;
@@ -41,11 +39,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin);
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)& Value() const;

View File

@@ -33,7 +33,7 @@ Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) BSWK;
BS->Poles(P);
Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
for ( i=P.Lower(); i<=P.Upper(); i++) {
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
Pt = MkPoint.Value();
Listpoints->SetValue(i, Pt);
}

View File

@@ -33,7 +33,7 @@ Handle(StepGeom_BSplineCurveWithKnots) BSWK;
BS->Poles(P);
Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
for ( i=P.Lower(); i<=P.Upper(); i++) {
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
Pt = MkPoint.Value();
Listpoints->SetValue(i, Pt);
}

View File

@@ -20,7 +20,6 @@
#include <GeomToStep_MakeBSplineSurfaceWithKnots.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BSplineSurfaceWithKnots.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_HArray2OfCartesianPoint.hxx>
@@ -35,9 +34,10 @@
// Creation d' une bspline_Surface_with_knots_and_rational_bspline_Surface de
// prostep a partir d' une BSplineSurface de Geom
//=============================================================================
GeomToStep_MakeBSplineSurfaceWithKnots::GeomToStep_MakeBSplineSurfaceWithKnots
( const Handle(Geom_BSplineSurface)& BS,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeBSplineSurfaceWithKnots::
GeomToStep_MakeBSplineSurfaceWithKnots( const
Handle(Geom_BSplineSurface)& BS )
{
Handle(StepGeom_BSplineSurfaceWithKnots) BSWK;
Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
@@ -62,7 +62,7 @@ GeomToStep_MakeBSplineSurfaceWithKnots::GeomToStep_MakeBSplineSurfaceWithKnots
aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
for ( j=P.LowerCol(); j<=P.UpperCol(); j++) {
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
Pt = MkPoint.Value();
aControlPointsList->SetValue(i, j, Pt);
}

View File

@@ -22,7 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineSurfaceWithKnots;
class Geom_BSplineSurface;
@@ -39,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin);
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnots)& Value() const;

View File

@@ -21,7 +21,6 @@
#include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_HArray2OfCartesianPoint.hxx>
@@ -38,7 +37,8 @@
//=============================================================================
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface( const
Handle(Geom_BSplineSurface)& BS, const StepData_Factors& theLocalFactors)
Handle(Geom_BSplineSurface)& BS )
{
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSWK;
Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
@@ -63,7 +63,7 @@ GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::
aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
for ( j=P.LowerCol(); j<=P.UpperCol(); j++) {
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
Pt = MkPoint.Value();
aControlPointsList->SetValue(i, j, Pt);
}

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
class Geom_BSplineSurface;
@@ -40,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin);
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)& Value() const;

View File

@@ -27,7 +27,6 @@
#include <GeomToStep_MakeBSplineCurveWithKnots.hxx>
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BoundedCurve.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
@@ -35,8 +34,7 @@
//=============================================================================
// Creation d' une BoundedCurve de prostep a partir d' une BoundedCurve de Geom
//=============================================================================
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C)
{
done = Standard_True;
@@ -50,11 +48,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
Bspli = newBspli;
}
if ( Bspli->IsRational() ) {
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
theBoundedCurve = MkRatBSplineC.Value();
}
else {
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
theBoundedCurve = MkBSplineC.Value();
}
}
@@ -62,11 +60,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
Handle(Geom_BezierCurve) Cur = Handle(Geom_BezierCurve)::DownCast(C);
Handle(Geom_BSplineCurve) Bspli = GeomConvert::CurveToBSplineCurve(Cur);
if ( Bspli->IsRational() ) {
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
theBoundedCurve = MkRatBSplineC.Value();
}
else {
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
theBoundedCurve = MkBSplineC.Value();
}
}
@@ -83,8 +81,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
// Geom2d
//=============================================================================
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C)
{
done = Standard_True;
if (C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)))
@@ -99,11 +96,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
Bspli = newBspli;
}
if ( Bspli->IsRational() ) {
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
theBoundedCurve = MkRatBSplineC.Value();
}
else {
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
theBoundedCurve = MkBSplineC.Value();
}
}
@@ -111,7 +108,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
Handle(Geom2d_BezierCurve) Cur = Handle(Geom2d_BezierCurve)::DownCast(C);
Handle(Geom2d_BSplineCurve) Bspli =
Geom2dConvert::CurveToBSplineCurve(Cur);
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
theBoundedCurve = MkBSplineC.Value();
}
else

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BoundedCurve;
class Geom_BoundedCurve;
class Geom2d_BoundedCurve;
@@ -41,11 +39,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C);
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C);
Standard_EXPORT const Handle(StepGeom_BoundedCurve)& Value() const;

View File

@@ -25,7 +25,6 @@
#include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
#include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BoundedSurface.hxx>
#include <StepGeom_BSplineSurfaceWithKnots.hxx>
#include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
@@ -36,8 +35,7 @@
// de Geom
//=============================================================================
GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
( const Handle(Geom_BoundedSurface)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_BoundedSurface)& S)
{
done = Standard_True;
if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
@@ -52,11 +50,11 @@ GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
}
if ( BS->IsURational() || BS->IsVRational() ) {
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
MkRatBSplineS(BS, theLocalFactors);
MkRatBSplineS(BS);
theBoundedSurface = MkRatBSplineS.Value();
}
else {
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS, theLocalFactors);
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
theBoundedSurface = MkBSplineS.Value();
}
}
@@ -66,18 +64,18 @@ GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
GeomConvert::SurfaceToBSplineSurface(Sur);
if ( BS->IsURational() || BS->IsVRational() ) {
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
MkRatBSplineS(BS, theLocalFactors);
MkRatBSplineS(BS);
theBoundedSurface = MkRatBSplineS.Value();
}
else {
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS, theLocalFactors);
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
theBoundedSurface = MkBSplineS.Value();
}
}
else if (S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
Handle(Geom_RectangularTrimmedSurface) Sur =
Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur, theLocalFactors);
GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur);
theBoundedSurface = MkRTSurf.Value();
}
else

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BoundedSurface;
class Geom_BoundedSurface;
@@ -40,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C);
Standard_EXPORT const Handle(StepGeom_BoundedSurface)& Value() const;

View File

@@ -21,7 +21,7 @@
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_StepModel.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
@@ -29,8 +29,7 @@
//=============================================================================
// Creation d' un cartesian_point de prostep a partir d' un point3d de gp
//=============================================================================
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P,
const Standard_Real aFactor)
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P)
{
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3);
@@ -43,7 +42,8 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P,
// Pstep->SetCoordinates(Acoord);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
// Pstep->SetName(name);
Pstep->Init3D (name,X/aFactor,Y/aFactor,Z/aFactor);
Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
theCartesianPoint = Pstep;
done = Standard_True;
}
@@ -51,10 +51,8 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P,
// Creation d' un cartesian_point de prostep a partir d' un point 2d de gp
//=============================================================================
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P,
const Standard_Real aFactor)
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P)
{
(void)aFactor;
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2);
Standard_Real X, Y;
@@ -75,8 +73,7 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P,
//=============================================================================
GeomToStep_MakeCartesianPoint::
GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P,
const Standard_Real aFactor)
GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P)
{
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
@@ -90,7 +87,8 @@ GeomToStep_MakeCartesianPoint::
// Pstep->SetCoordinates(Acoord);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
// Pstep->SetName(name);
Pstep->Init3D (name,X/aFactor,Y/aFactor,Z/aFactor);
Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
theCartesianPoint = Pstep;
done = Standard_True;
}

View File

@@ -27,7 +27,6 @@ class gp_Pnt;
class gp_Pnt2d;
class Geom_CartesianPoint;
class Geom2d_CartesianPoint;
class StepData_StepModel;
//! This class implements the mapping between classes
@@ -41,14 +40,11 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt& P,
const Standard_Real aFactor);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt& P);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt2d& P,
const Standard_Real aFactor);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt2d& P);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom_CartesianPoint)& P,
const Standard_Real aFactor);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom_CartesianPoint)& P);
Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom2d_CartesianPoint)& P);

View File

@@ -23,7 +23,7 @@
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Circle.hxx>
@@ -32,8 +32,7 @@
//=============================================================================
// Creation d' un cercle de prostep a partir d' un cercle 3d de gp
//=============================================================================
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C)
{
#include "GeomToStep_MakeCircle_gen.pxx"
}
@@ -44,8 +43,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C,
// Geom
//=============================================================================
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer)
{
gp_Circ C;
C = Cer->Circ();
@@ -58,8 +56,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer,
// Geom2d
//=============================================================================
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer)
{
gp_Circ2d C2d;
C2d = Cer->Circ2d();
@@ -69,7 +66,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer,
Handle(StepGeom_Axis2Placement2d) Ax2Step;
Standard_Real Rayon;
GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position());
Ax2Step = MkAxis2.Value();
Rayon = C2d.Radius();
Ax2.SetValue(Ax2Step);

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Circle;
class gp_Circ;
class Geom_Circle;
@@ -41,14 +39,11 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C);
Standard_EXPORT const Handle(StepGeom_Circle)& Value() const;

View File

@@ -19,12 +19,12 @@ Handle(StepGeom_Circle) CStep = new StepGeom_Circle;
Handle(StepGeom_Axis2Placement3d) Ax2Step;
Standard_Real Rayon;
GeomToStep_MakeAxis2Placement3d MkAxis2(C.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(C.Position());
Ax2Step = MkAxis2.Value();
Rayon = C.Radius();
Ax2.SetValue(Ax2Step);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
CStep->Init(name, Ax2, Rayon / theLocalFactors.LengthFactor());
CStep->Init(name, Ax2, Rayon / StepData_GlobalFactors::Intance().LengthFactor());
theCircle = CStep;
done = Standard_True;

View File

@@ -31,7 +31,6 @@
#include <GeomToStep_MakeHyperbola.hxx>
#include <GeomToStep_MakeParabola.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Conic.hxx>
#include <StepGeom_Ellipse.hxx>
@@ -41,28 +40,27 @@
//=============================================================================
// Creation d' une Conic de prostep a partir d' une Conic de Geom
//=============================================================================
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C)
{
done = Standard_True;
if (C->IsKind(STANDARD_TYPE(Geom_Circle))) {
Handle(Geom_Circle) Cer = Handle(Geom_Circle)::DownCast(C);
GeomToStep_MakeCircle MkCircle(Cer, theLocalFactors);
GeomToStep_MakeCircle MkCircle(Cer);
theConic = MkCircle.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_Ellipse))) {
Handle(Geom_Ellipse) Ell = Handle(Geom_Ellipse)::DownCast(C);
GeomToStep_MakeEllipse MkEllipse(Ell, theLocalFactors);
GeomToStep_MakeEllipse MkEllipse(Ell);
theConic = MkEllipse.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_Hyperbola))) {
Handle(Geom_Hyperbola) Hyp = Handle(Geom_Hyperbola)::DownCast(C);
GeomToStep_MakeHyperbola MkHyperbola(Hyp, theLocalFactors);
GeomToStep_MakeHyperbola MkHyperbola(Hyp);
theConic = MkHyperbola.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_Parabola))) {
Handle(Geom_Parabola) Par = Handle(Geom_Parabola)::DownCast(C);
GeomToStep_MakeParabola MkParabola(Par, theLocalFactors);
GeomToStep_MakeParabola MkParabola(Par);
theConic = MkParabola.Value();
}
else {
@@ -77,28 +75,27 @@ GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C,
// Creation d' une Conic2d de prostep a partir d' une Conic de Geom2d
//=============================================================================
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C)
{
done = Standard_True;
if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
Handle(Geom2d_Circle) Cer = Handle(Geom2d_Circle)::DownCast(C);
GeomToStep_MakeCircle MkCircle(Cer, theLocalFactors);
GeomToStep_MakeCircle MkCircle(Cer);
theConic = MkCircle.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
Handle(Geom2d_Ellipse) Ell = Handle(Geom2d_Ellipse)::DownCast(C);
GeomToStep_MakeEllipse MkEllipse(Ell, theLocalFactors);
GeomToStep_MakeEllipse MkEllipse(Ell);
theConic = MkEllipse.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
Handle(Geom2d_Hyperbola) Hyp = Handle(Geom2d_Hyperbola)::DownCast(C);
GeomToStep_MakeHyperbola MkHyperbola(Hyp, theLocalFactors);
GeomToStep_MakeHyperbola MkHyperbola(Hyp);
theConic = MkHyperbola.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
Handle(Geom2d_Parabola) Par = Handle(Geom2d_Parabola)::DownCast(C);
GeomToStep_MakeParabola MkParabola(Par, theLocalFactors);
GeomToStep_MakeParabola MkParabola(Par);
theConic = MkParabola.Value();
}
else {

View File

@@ -25,7 +25,6 @@
class StepGeom_Conic;
class Geom_Conic;
class Geom2d_Conic;
class StepData_Factors;
//! This class implements the mapping between classes
@@ -39,11 +38,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C);
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C);
Standard_EXPORT const Handle(StepGeom_Conic)& Value() const;

View File

@@ -20,7 +20,7 @@
#include <GeomToStep_MakeConicalSurface.hxx>
#include <Standard_DomainError.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_ConicalSurface.hxx>
#include <TCollection_HAsciiString.hxx>
@@ -30,14 +30,14 @@
// de Geom
//=============================================================================
GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface
( const Handle(Geom_ConicalSurface)& CS, const StepData_Factors& theLocalFactors)
( const Handle(Geom_ConicalSurface)& CS )
{
Handle(StepGeom_ConicalSurface) CSstep = new StepGeom_ConicalSurface;
Handle(StepGeom_Axis2Placement3d) aPosition;
Standard_Real aRadius, aSemiAngle;
GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position());
aPosition = MkAxis.Value();
aRadius = CS->RefRadius();
aSemiAngle = CS->SemiAngle();
@@ -46,7 +46,7 @@ GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface
}
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
CSstep->Init(name, aPosition, aRadius / theLocalFactors.LengthFactor(), aSemiAngle);
CSstep->Init(name, aPosition, aRadius / StepData_GlobalFactors::Intance().LengthFactor(), aSemiAngle);
theConicalSurface = CSstep;
done = Standard_True;
}

View File

@@ -24,7 +24,6 @@
#include <GeomToStep_Root.hxx>
class StepGeom_ConicalSurface;
class Geom_ConicalSurface;
class StepData_Factors;
//! This class implements the mapping between class
@@ -38,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf);
Standard_EXPORT const Handle(StepGeom_ConicalSurface)& Value() const;

View File

@@ -37,7 +37,6 @@
#include <gp_Circ2d.hxx>
#include <gp_Elips2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_BoundedCurve.hxx>
#include <StepGeom_Conic.hxx>
@@ -48,18 +47,17 @@
//=============================================================================
// Creation d' une Curve de prostep a partir d' une Curve de Geom
//=============================================================================
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
{
done = Standard_True;
if (C->IsKind(STANDARD_TYPE(Geom_Line))) {
Handle(Geom_Line) L = Handle(Geom_Line)::DownCast(C);
GeomToStep_MakeLine MkLine(L, theLocalFactors);
GeomToStep_MakeLine MkLine(L);
theCurve = MkLine.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_Conic))) {
Handle(Geom_Conic) L = Handle(Geom_Conic)::DownCast(C);
GeomToStep_MakeConic MkConic(L, theLocalFactors);
GeomToStep_MakeConic MkConic(L);
theCurve = MkConic.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
@@ -84,12 +82,12 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C,
std::cout<<"BasisCurve Type : "<<B->DynamicType()->Name()<<std::endl;
#endif
}
GeomToStep_MakeCurve MkBasisC(B, theLocalFactors);
GeomToStep_MakeCurve MkBasisC(B);
theCurve = MkBasisC.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom_BoundedCurve))) {
Handle(Geom_BoundedCurve) L = Handle(Geom_BoundedCurve)::DownCast(C);
GeomToStep_MakeBoundedCurve MkBoundedC(L, theLocalFactors);
GeomToStep_MakeBoundedCurve MkBoundedC(L);
theCurve = MkBoundedC.Value();
}
else
@@ -100,13 +98,12 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C,
// Creation d'une Curve de prostep a partir d' une Curve de Geom2d
//=============================================================================
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
{
done = Standard_True;
if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(C);
GeomToStep_MakeLine MkLine(L, theLocalFactors);
GeomToStep_MakeLine MkLine(L);
theCurve = MkLine.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
@@ -127,12 +124,12 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C,
Handle(Geom2d_BSplineCurve) aBSplineCurve2d =
Geom2dConvert::CurveToBSplineCurve(theC2d);
const Handle(Geom2d_BoundedCurve)& aBC2d = aBSplineCurve2d; // to avoid ambiguity
GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d, theLocalFactors);
GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d);
theCurve = MkBoundedC.Value();
}
else {
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
GeomToStep_MakeConic MkConic(L, theLocalFactors);
GeomToStep_MakeConic MkConic(L);
theCurve = MkConic.Value();
}
}
@@ -146,28 +143,28 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C,
Handle(Geom2d_BSplineCurve) aBSplineCurve2d =
Geom2dConvert::CurveToBSplineCurve(theE2d);
const Handle(Geom2d_BoundedCurve)& aBC2d = aBSplineCurve2d; // to avoid ambiguity
GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d, theLocalFactors);
GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d);
theCurve = MkBoundedC.Value();
}
else {
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
GeomToStep_MakeConic MkConic(L, theLocalFactors);
GeomToStep_MakeConic MkConic(L);
theCurve = MkConic.Value();
}
}
else {
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
GeomToStep_MakeConic MkConic(L, theLocalFactors);
GeomToStep_MakeConic MkConic(L);
theCurve = MkConic.Value();
}
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve))) {
Handle(Geom2d_BoundedCurve) L = Handle(Geom2d_BoundedCurve)::DownCast(C);
GeomToStep_MakeBoundedCurve MkBoundedC(L, theLocalFactors);
GeomToStep_MakeBoundedCurve MkBoundedC(L);
theCurve = MkBoundedC.Value();
}
else if (C->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) {
GeomToStep_MakeCurve aMaker(Handle(Geom2d_TrimmedCurve)::DownCast(C)->BasisCurve(), theLocalFactors);
GeomToStep_MakeCurve aMaker = (Handle(Geom2d_TrimmedCurve)::DownCast(C)->BasisCurve());
theCurve = aMaker.Value();
}
else

View File

@@ -22,7 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Curve;
class Geom_Curve;
class Geom2d_Curve;
@@ -39,11 +38,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C);
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C);
Standard_EXPORT const Handle(StepGeom_Curve)& Value() const;

View File

@@ -19,7 +19,7 @@
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <GeomToStep_MakeCylindricalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_CylindricalSurface.hxx>
#include <TCollection_HAsciiString.hxx>
@@ -29,19 +29,19 @@
// CylindricalSurface de Geom
//=============================================================================
GeomToStep_MakeCylindricalSurface::GeomToStep_MakeCylindricalSurface
( const Handle(Geom_CylindricalSurface)& CS,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_CylindricalSurface)& CS )
{
Handle(StepGeom_CylindricalSurface) CSstep;
Handle(StepGeom_Axis2Placement3d) aPosition;
Standard_Real aRadius;
GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position());
aPosition = MkAxis2.Value();
aRadius = CS->Radius();
CSstep = new StepGeom_CylindricalSurface;
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
CSstep->Init(name, aPosition, aRadius / theLocalFactors.LengthFactor());
CSstep->Init(name, aPosition, aRadius / StepData_GlobalFactors::Intance().LengthFactor());
theCylindricalSurface = CSstep;
done = Standard_True;
}

View File

@@ -24,7 +24,6 @@
#include <GeomToStep_Root.hxx>
class StepGeom_CylindricalSurface;
class Geom_CylindricalSurface;
class StepData_Factors;
//! This class implements the mapping between class
@@ -38,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf);
Standard_EXPORT const Handle(StepGeom_CylindricalSurface)& Value() const;

View File

@@ -28,7 +28,6 @@
#include <GeomToStep_MakeSphericalSurface.hxx>
#include <GeomToStep_MakeToroidalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_ConicalSurface.hxx>
#include <StepGeom_CylindricalSurface.hxx>
#include <StepGeom_ElementarySurface.hxx>
@@ -41,37 +40,36 @@
// ElementarySurface de Geom
//=============================================================================
GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface
( const Handle(Geom_ElementarySurface)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_ElementarySurface)& S)
{
done = Standard_True;
if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
Handle(Geom_CylindricalSurface) Sur =
Handle(Geom_CylindricalSurface)::DownCast(S);
GeomToStep_MakeCylindricalSurface MkCylindrical(Sur, theLocalFactors);
GeomToStep_MakeCylindricalSurface MkCylindrical(Sur);
theElementarySurface = MkCylindrical.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
Handle(Geom_ConicalSurface) Sur =
Handle(Geom_ConicalSurface)::DownCast(S);
GeomToStep_MakeConicalSurface MkConical(Sur, theLocalFactors);
GeomToStep_MakeConicalSurface MkConical(Sur);
theElementarySurface = MkConical.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
Handle(Geom_SphericalSurface) Sur =
Handle(Geom_SphericalSurface)::DownCast(S);
GeomToStep_MakeSphericalSurface MkSpherical(Sur, theLocalFactors);
GeomToStep_MakeSphericalSurface MkSpherical(Sur);
theElementarySurface = MkSpherical.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
Handle(Geom_ToroidalSurface) Sur =
Handle(Geom_ToroidalSurface)::DownCast(S);
GeomToStep_MakeToroidalSurface MkToroidal(Sur, theLocalFactors);
GeomToStep_MakeToroidalSurface MkToroidal(Sur);
theElementarySurface = MkToroidal.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_Plane))) {
Handle(Geom_Plane) Sur = Handle(Geom_Plane)::DownCast(S);
GeomToStep_MakePlane MkPlane(Sur, theLocalFactors);
GeomToStep_MakePlane MkPlane(Sur);
theElementarySurface = MkPlane.Value();
}
else

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_ElementarySurface;
class Geom_ElementarySurface;
@@ -40,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S);
Standard_EXPORT const Handle(StepGeom_ElementarySurface)& Value() const;

View File

@@ -23,7 +23,7 @@
#include <gp_Elips.hxx>
#include <gp_Elips2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Ellipse.hxx>
@@ -32,8 +32,7 @@
//=============================================================================
// Creation d'une ellipse de prostep a partir d'une ellipse 3d de gp
//=============================================================================
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E)
{
#include "GeomToStep_MakeEllipse_gen.pxx"
}
@@ -44,8 +43,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E,
// Geom
//=============================================================================
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer)
{
gp_Elips E;
E = Cer->Elips();
@@ -58,8 +56,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer,
// Geom2d
//=============================================================================
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer)
{
gp_Elips2d E2d;
E2d = Cer->Elips2d();
@@ -69,7 +66,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Ce
Handle(StepGeom_Axis2Placement2d) Ax2Step;
Standard_Real majorR, minorR;
GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis(), theLocalFactors);
GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis());
Ax2Step = MkAxis2.Value();
majorR = E2d.MajorRadius();
minorR = E2d.MinorRadius();

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Ellipse;
class gp_Elips;
class Geom_Ellipse;
@@ -41,14 +39,11 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C);
Standard_EXPORT const Handle(StepGeom_Ellipse)& Value() const;

View File

@@ -19,13 +19,13 @@ Handle(StepGeom_Ellipse) EStep = new StepGeom_Ellipse;
Handle(StepGeom_Axis2Placement3d) Ax2Step;
Standard_Real majorR, minorR;
GeomToStep_MakeAxis2Placement3d MkAxis2(E.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(E.Position());
Ax2Step = MkAxis2.Value();
majorR = E.MajorRadius();
minorR = E.MinorRadius();
Ax2.SetValue(Ax2Step);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
Standard_Real fact = theLocalFactors.LengthFactor();
Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
EStep->Init(name, Ax2,majorR/fact,minorR/fact);
theEllipse = EStep;
done = Standard_True;

View File

@@ -20,7 +20,7 @@
#include <gp_Hypr.hxx>
#include <gp_Hypr2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Hyperbola.hxx>
@@ -30,8 +30,7 @@
// Creation d'une hyperbola de prostep a partir d'une hyperbola de
// Geom2d
//=============================================================================
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C)
{
gp_Hypr2d gpHyp;
gpHyp = C->Hypr2d();
@@ -41,7 +40,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
Handle(StepGeom_Axis2Placement2d) Ax2Step;
Standard_Real majorR, minorR;
GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis(), theLocalFactors);
GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis());
Ax2Step = MkAxis2.Value();
majorR = gpHyp.MajorRadius();
minorR = gpHyp.MinorRadius();
@@ -57,8 +56,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
// Geom
//=============================================================================
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C)
{
gp_Hypr gpHyp;
gpHyp = C->Hypr();
@@ -68,13 +66,13 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
Handle(StepGeom_Axis2Placement3d) Ax2Step;
Standard_Real majorR, minorR;
GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position());
Ax2Step = MkAxis2.Value();
majorR = gpHyp.MajorRadius();
minorR = gpHyp.MinorRadius();
Ax2.SetValue(Ax2Step);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
Standard_Real fact = theLocalFactors.LengthFactor();
Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
HStep->Init(name, Ax2,majorR/fact,minorR/fact);
theHyperbola = HStep;
done = Standard_True;

View File

@@ -37,11 +37,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C);
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C);
Standard_EXPORT const Handle(StepGeom_Hyperbola)& Value() const;

View File

@@ -25,7 +25,6 @@
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Vector.hxx>
@@ -34,8 +33,7 @@
//=============================================================================
// Creation d' une line de prostep a partir d' une Lin de gp
//=============================================================================
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L)
{
#define Vec_gen gp_Vec
#include "GeomToStep_MakeLine_gen.pxx"
@@ -46,8 +44,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L,
// Creation d' une line de prostep a partir d' une Lin2d de gp
//=============================================================================
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L)
{
#define Vec_gen gp_Vec2d
#include "GeomToStep_MakeLine_gen.pxx"
@@ -58,8 +55,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L,
// Creation d' une line de prostep a partir d' une Line de Geom
//=============================================================================
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline)
{
gp_Lin L;
L = Gline->Lin();
@@ -72,8 +68,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline,
// Creation d' une line de prostep a partir d' une Line de Geom2d
//=============================================================================
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline)
{
gp_Lin2d L;
L = Gline->Lin2d();

View File

@@ -22,7 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Line;
class gp_Lin;
class gp_Lin2d;
@@ -41,17 +40,13 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L);
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C);
Standard_EXPORT const Handle(StepGeom_Line)& Value() const;

View File

@@ -18,8 +18,8 @@ Handle(StepGeom_Line) Lin = new StepGeom_Line;
Handle(StepGeom_CartesianPoint) aPnt;
Handle(StepGeom_Vector) aDir;
GeomToStep_MakeCartesianPoint MkPoint(L.Location(), theLocalFactors.LengthFactor());
GeomToStep_MakeVector MkVector(Vec_gen(L.Direction()), theLocalFactors);
GeomToStep_MakeCartesianPoint MkPoint(L.Location());
GeomToStep_MakeVector MkVector(Vec_gen(L.Direction()));
aPnt = MkPoint.Value();
aDir = MkVector.Value();
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");

View File

@@ -20,7 +20,7 @@
#include <gp_Parab.hxx>
#include <gp_Parab2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Parabola.hxx>
@@ -30,8 +30,7 @@
// Creation d'une Parabola de prostep a partir d'une Parabola de
// Geom2d
//=============================================================================
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
{
gp_Parab2d gpPar;
gpPar = C->Parab2d();
@@ -41,7 +40,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
Handle(StepGeom_Axis2Placement2d) Ax2Step;
Standard_Real focal;
GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis(), theLocalFactors);
GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
Ax2Step = MkAxis2.Value();
focal = gpPar.Focal();
Ax2.SetValue(Ax2Step);
@@ -56,8 +55,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
// Geom
//=============================================================================
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
{
gp_Parab gpPar;
gpPar = C->Parab();
@@ -67,12 +65,12 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
Handle(StepGeom_Axis2Placement3d) Ax2Step;
Standard_Real focal;
GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
Ax2Step = MkAxis2.Value();
focal = gpPar.Focal();
Ax2.SetValue(Ax2Step);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
PStep->Init(name, Ax2, focal / theLocalFactors.LengthFactor());
PStep->Init(name, Ax2, focal / StepData_GlobalFactors::Intance().LengthFactor());
theParabola = PStep;
done = Standard_True;
}

View File

@@ -25,7 +25,6 @@
class StepGeom_Parabola;
class Geom2d_Parabola;
class Geom_Parabola;
class StepData_Factors;
//! This class implements the mapping between the class
@@ -38,11 +37,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C);
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C);
Standard_EXPORT const Handle(StepGeom_Parabola)& Value() const;

View File

@@ -27,13 +27,12 @@
//=============================================================================
// Creation d' un plane de prostep a partir d' un Pln de gp
//=============================================================================
GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P,
const StepData_Factors& theLocalFactors)
GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P)
{
Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
Handle(StepGeom_Axis2Placement3d) aPosition;
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
aPosition = MkAxis2.Value();
Plan->SetPosition(aPosition);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
@@ -46,8 +45,7 @@ GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P,
// Creation d' un plane de prostep a partir d' un Plane de Geom
//=============================================================================
GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln,
const StepData_Factors& theLocalFactors)
GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln)
{
gp_Pln P;
Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
@@ -55,7 +53,7 @@ GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln,
P = Gpln->Pln();
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
aPosition = MkAxis2.Value();
Plan->SetPosition(aPosition);
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");

View File

@@ -22,7 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Plane;
class gp_Pln;
class Geom_Plane;
@@ -39,11 +38,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P);
Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P);
Standard_EXPORT const Handle(StepGeom_Plane)& Value() const;

View File

@@ -20,7 +20,6 @@
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Polyline.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
@@ -29,8 +28,7 @@
//=============================================================================
// Creation d' une polyline Step a partir d' une Array1OfPnt
//=============================================================================
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P,
const StepData_Factors& theLocalFactors)
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P)
{
gp_Pnt P1;
#include "GeomToStep_MakePolyline_gen.pxx"
@@ -40,8 +38,7 @@ GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P,
// Creation d' une polyline Step a partir d' une Array1OfPnt2d
//=============================================================================
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P,
const StepData_Factors& theLocalFactors)
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P)
{
gp_Pnt2d P1;
#include "GeomToStep_MakePolyline_gen.pxx"

View File

@@ -24,8 +24,6 @@
#include <GeomToStep_Root.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
class StepData_Factors;
class StepGeom_Polyline;
@@ -38,11 +36,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P);
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P);
Standard_EXPORT const Handle(StepGeom_Polyline)& Value() const;

View File

@@ -22,7 +22,7 @@ Standard_Integer N, i;
aPoints = new StepGeom_HArray1OfCartesianPoint(1,N);
for (i=P.Lower(); i<=P.Upper(); i++) {
P1 = P.Value(i);
GeomToStep_MakeCartesianPoint MkPoint(P1, theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(P1);
P2 = MkPoint.Value();
aPoints->SetValue(i,P2);
}

View File

@@ -25,7 +25,7 @@
#include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
#include <GeomToStep_MakeSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_RectangularTrimmedSurface.hxx>
#include <StepGeom_Surface.hxx>
#include <TCollection_HAsciiString.hxx>
@@ -36,15 +36,15 @@
//=============================================================================
GeomToStep_MakeRectangularTrimmedSurface::
GeomToStep_MakeRectangularTrimmedSurface( const
Handle(Geom_RectangularTrimmedSurface)& RTSurf,
const StepData_Factors& theLocalFactors)
Handle(Geom_RectangularTrimmedSurface)& RTSurf )
{
Handle(StepGeom_RectangularTrimmedSurface) StepRTS = new StepGeom_RectangularTrimmedSurface;
Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString("");
GeomToStep_MakeSurface mkSurf(RTSurf->BasisSurface(), theLocalFactors);
GeomToStep_MakeSurface mkSurf(RTSurf->BasisSurface());
if (!mkSurf.IsDone()) {
done = Standard_False;
return;
@@ -61,7 +61,7 @@ GeomToStep_MakeRectangularTrimmedSurface::
Standard_Real AngleFact = 180./M_PI;
Standard_Real uFact = 1.;
Standard_Real vFact = 1.;
Standard_Real LengthFact = theLocalFactors.LengthFactor();
Standard_Real LengthFact = StepData_GlobalFactors::Intance().LengthFactor();
Handle(Geom_Surface) theSurf = RTSurf->BasisSurface();
if (theSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
uFact = AngleFact;

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_RectangularTrimmedSurface;
class Geom_RectangularTrimmedSurface;
@@ -40,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf);
Standard_EXPORT const Handle(StepGeom_RectangularTrimmedSurface)& Value() const;

View File

@@ -19,29 +19,29 @@
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <GeomToStep_MakeSphericalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_SphericalSurface.hxx>
#include <TCollection_HAsciiString.hxx>
#include <StepData_GlobalFactors.hxx>
//=============================================================================
// Creation d' une conical_surface de prostep a partir d' une SphericalSurface
// de Geom
//=============================================================================
GeomToStep_MakeSphericalSurface::GeomToStep_MakeSphericalSurface
( const Handle(Geom_SphericalSurface)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_SphericalSurface)& S )
{
Handle(StepGeom_SphericalSurface) Surf;
Handle(StepGeom_Axis2Placement3d) aPosition;
Standard_Real aRadius;
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
aPosition = MkAxis2.Value();
aRadius = S->Radius();
Surf = new StepGeom_SphericalSurface;
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
Surf->Init(name, aPosition, aRadius/ theLocalFactors.LengthFactor());
Surf->Init(name, aPosition, aRadius/ StepData_GlobalFactors::Intance().LengthFactor());
theSphericalSurface = Surf;
done = Standard_True;
}

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SphericalSurface;
class Geom_SphericalSurface;
@@ -39,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf);
Standard_EXPORT const Handle(StepGeom_SphericalSurface)& Value() const;

View File

@@ -26,48 +26,47 @@
#include <GeomToStep_MakeSweptSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Logical.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_BoundedSurface.hxx>
#include <StepGeom_ElementarySurface.hxx>
#include <StepGeom_OffsetSurface.hxx>
#include <StepGeom_Surface.hxx>
#include <StepGeom_SweptSurface.hxx>
#include <TCollection_HAsciiString.hxx>
#include <StepData_GlobalFactors.hxx>
//=============================================================================
// Creation d' une Surface de prostep a partir d' une Surface de Geom
//=============================================================================
GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S)
{
done = Standard_True;
if (S->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) {
Handle(Geom_BoundedSurface) S1 =
Handle(Geom_BoundedSurface)::DownCast(S);
GeomToStep_MakeBoundedSurface MkBoundedS(S1, theLocalFactors);
GeomToStep_MakeBoundedSurface MkBoundedS(S1);
theSurface = MkBoundedS.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) {
Handle(Geom_ElementarySurface) S1 =
Handle(Geom_ElementarySurface)::DownCast(S);
GeomToStep_MakeElementarySurface MkElementaryS(S1, theLocalFactors);
GeomToStep_MakeElementarySurface MkElementaryS(S1);
theSurface = MkElementaryS.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_SweptSurface))) {
Handle(Geom_SweptSurface) S1 =
Handle(Geom_SweptSurface)::DownCast(S);
GeomToStep_MakeSweptSurface MkSwept(S1, theLocalFactors);
GeomToStep_MakeSweptSurface MkSwept(S1);
theSurface = MkSwept.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
Handle(Geom_OffsetSurface) S1 =
Handle(Geom_OffsetSurface)::DownCast(S);
GeomToStep_MakeSurface MkBasis(S1->BasisSurface(), theLocalFactors);
GeomToStep_MakeSurface MkBasis(S1->BasisSurface());
done = MkBasis.IsDone();
if (!done) return;
Handle(StepGeom_OffsetSurface) Surf = new StepGeom_OffsetSurface;
Surf->Init (new TCollection_HAsciiString(""),
MkBasis.Value(),S1->Offset()/ theLocalFactors.LengthFactor(),StepData_LFalse);
MkBasis.Value(),S1->Offset()/ StepData_GlobalFactors::Intance().LengthFactor(),StepData_LFalse);
theSurface = Surf;
}
else {

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Surface;
class Geom_Surface;
@@ -39,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C);
Standard_EXPORT const Handle(StepGeom_Surface)& Value() const;

View File

@@ -21,7 +21,6 @@
#include <GeomToStep_MakeVector.hxx>
#include <gp_Vec.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_SurfaceOfLinearExtrusion.hxx>
#include <StepGeom_Vector.hxx>
@@ -32,15 +31,15 @@
// SurfaceOfLinearExtrusion de Geom
//=============================================================================
GeomToStep_MakeSurfaceOfLinearExtrusion::GeomToStep_MakeSurfaceOfLinearExtrusion
( const Handle(Geom_SurfaceOfLinearExtrusion)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_SurfaceOfLinearExtrusion)& S )
{
Handle(StepGeom_SurfaceOfLinearExtrusion) Surf;
Handle(StepGeom_Curve) aSweptCurve;
Handle(StepGeom_Vector) aExtrusionAxis;
GeomToStep_MakeCurve MkCurve(S->BasisCurve(), theLocalFactors);
GeomToStep_MakeVector MkVector(gp_Vec(S->Direction()), theLocalFactors);
GeomToStep_MakeCurve MkCurve(S->BasisCurve());
GeomToStep_MakeVector MkVector(gp_Vec(S->Direction()));
aSweptCurve = MkCurve.Value();
aExtrusionAxis = MkVector.Value();

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SurfaceOfLinearExtrusion;
class Geom_SurfaceOfLinearExtrusion;
@@ -39,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf);
Standard_EXPORT const Handle(StepGeom_SurfaceOfLinearExtrusion)& Value() const;

View File

@@ -20,7 +20,6 @@
#include <GeomToStep_MakeCurve.hxx>
#include <GeomToStep_MakeSurfaceOfRevolution.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_Axis1Placement.hxx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_SurfaceOfRevolution.hxx>
@@ -31,15 +30,15 @@
// SurfaceOfRevolution de Geom
//=============================================================================
GeomToStep_MakeSurfaceOfRevolution::GeomToStep_MakeSurfaceOfRevolution
( const Handle(Geom_SurfaceOfRevolution)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_SurfaceOfRevolution)& S )
{
Handle(StepGeom_SurfaceOfRevolution) Surf;
Handle(StepGeom_Curve) aSweptCurve;
Handle(StepGeom_Axis1Placement) aAxisPosition;
GeomToStep_MakeCurve MkSwept(S->BasisCurve(), theLocalFactors);
GeomToStep_MakeAxis1Placement MkAxis1(S->Axis(), theLocalFactors);
GeomToStep_MakeCurve MkSwept(S->BasisCurve());
GeomToStep_MakeAxis1Placement MkAxis1(S->Axis());
aSweptCurve = MkSwept.Value();
aAxisPosition = MkAxis1.Value();
Surf = new StepGeom_SurfaceOfRevolution;

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SurfaceOfRevolution;
class Geom_SurfaceOfRevolution;
@@ -39,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf);
Standard_EXPORT const Handle(StepGeom_SurfaceOfRevolution)& Value() const;

View File

@@ -22,7 +22,6 @@
#include <GeomToStep_MakeSurfaceOfRevolution.hxx>
#include <GeomToStep_MakeSweptSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_SurfaceOfLinearExtrusion.hxx>
#include <StepGeom_SurfaceOfRevolution.hxx>
#include <StepGeom_SweptSurface.hxx>
@@ -33,20 +32,19 @@
// SweptSurface de Geom
//=============================================================================
GeomToStep_MakeSweptSurface::GeomToStep_MakeSweptSurface
( const Handle(Geom_SweptSurface)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_SweptSurface)& S)
{
done = Standard_True;
if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) {
Handle(Geom_SurfaceOfLinearExtrusion) Sur =
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(S);
GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur, theLocalFactors);
GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur);
theSweptSurface = MkLinear.Value();
}
else if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
Handle(Geom_SurfaceOfRevolution) Sur =
Handle(Geom_SurfaceOfRevolution)::DownCast(S);
GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur, theLocalFactors);
GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur);
theSweptSurface = MkRevol.Value();
}
else

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SweptSurface;
class Geom_SweptSurface;
@@ -40,8 +38,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S);
Standard_EXPORT const Handle(StepGeom_SweptSurface)& Value() const;

View File

@@ -19,29 +19,29 @@
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <GeomToStep_MakeToroidalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_ToroidalSurface.hxx>
#include <TCollection_HAsciiString.hxx>
#include <StepData_GlobalFactors.hxx>
//=============================================================================
// Creation d' une toroidal_surface de prostep a partir d' une ToroidalSurface
// de Geom
//=============================================================================
GeomToStep_MakeToroidalSurface::GeomToStep_MakeToroidalSurface
( const Handle(Geom_ToroidalSurface)& S,
const StepData_Factors& theLocalFactors)
( const Handle(Geom_ToroidalSurface)& S )
{
Handle(StepGeom_ToroidalSurface) Surf;
Handle(StepGeom_Axis2Placement3d) aPosition;
Standard_Real aMajorRadius, aMinorRadius;
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
aPosition = MkAxis2.Value();
aMajorRadius = S->MajorRadius();
aMinorRadius = S->MinorRadius();
Surf = new StepGeom_ToroidalSurface;
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
Standard_Real fact = theLocalFactors.LengthFactor();
Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
Surf->Init(name, aPosition, aMajorRadius/fact, aMinorRadius/fact);
theToroidalSurface = Surf;
done = Standard_True;

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_ToroidalSurface;
class Geom_ToroidalSurface;
@@ -39,8 +37,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf);
Standard_EXPORT const Handle(StepGeom_ToroidalSurface)& Value() const;

View File

@@ -24,28 +24,25 @@
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <StdFail_NotDone.hxx>
#include <StepData_Factors.hxx>
#include <StepData_GlobalFactors.hxx>
#include <StepGeom_Vector.hxx>
#include <TCollection_HAsciiString.hxx>
//=============================================================================
// Creation d' un vector de prostep a partir d' un Vec de gp
//=============================================================================
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V)
{
gp_Dir D = gp_Dir(V);
Standard_Real lFactor = theLocalFactors.LengthFactor();
Standard_Real lFactor = StepData_GlobalFactors::Intance().LengthFactor();
#include "GeomToStep_MakeVector_gen.pxx"
}
//=============================================================================
// Creation d' un vector de prostep a partir d' un Vec2d de gp
//=============================================================================
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V)
{
(void)theLocalFactors;
gp_Dir2d D = gp_Dir2d(V);
Standard_Real lFactor = 1.;
#include "GeomToStep_MakeVector_gen.pxx"
@@ -55,13 +52,13 @@ GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V,
// Creation d' un vector de prostep a partir d' un Vector de Geom
//=============================================================================
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)& GVector,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)&
GVector)
{
gp_Vec V;
V = GVector->Vec();
gp_Dir D = gp_Dir(V);
Standard_Real lFactor = theLocalFactors.LengthFactor();
Standard_Real lFactor = StepData_GlobalFactors::Intance().LengthFactor();
#include "GeomToStep_MakeVector_gen.pxx"
}
@@ -69,10 +66,9 @@ GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)& GVecto
// Creation d' un vector de prostep a partir d' un Vector de Geom2d
//=============================================================================
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)& GVector,
const StepData_Factors& theLocalFactors)
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)&
GVector)
{
(void)theLocalFactors;
gp_Vec2d V;
V = GVector->Vec2d();
gp_Dir2d D = gp_Dir2d(V);

View File

@@ -22,8 +22,6 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Vector;
class gp_Vec;
class gp_Vec2d;
@@ -42,17 +40,13 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V);
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V,
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V);
Standard_EXPORT const Handle(StepGeom_Vector)& Value() const;

View File

@@ -73,7 +73,7 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, Tol, maxTol,
"write.iges.resource.name",
"write.iges.sequence", info,
theProgress, false, TopAbs_EDGE);
theProgress );
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
BRepToIGES_BREntity BR0; BR0.SetModel(modl); BR0.SetTransferProcess(FP);

View File

@@ -92,7 +92,7 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape,
TopoDS_Shape Shape = XSAlgo::AlgoContainer()->ProcessShape( theShape, Tol, maxTol,
"write.iges.resource.name",
"write.iges.sequence", info,
aPS.Next(), false, TopAbs_EDGE);
aPS.Next());
if (!aPS.More())
return Standard_False;

View File

@@ -198,7 +198,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
"read.iges.resource.name",
"read.iges.sequence",
info, mymodel->ReShape(),
aPS.Next(), false, TopAbs_EDGE);
aPS.Next());
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
}

View File

@@ -552,7 +552,7 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num,
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
"read.iges.resource.name",
"read.iges.sequence", info,
aPS.Next(), false, TopAbs_EDGE);
aPS.Next() );
if (aPS.UserBreak())
return Standard_False;

View File

@@ -135,10 +135,6 @@ namespace
Image_FreeImageStream (std::istream& theStream)
: myIStream (&theStream), myOStream (NULL), myInitPos (theStream.tellg()) {}
//! Construct wrapper over output stream.
Image_FreeImageStream (std::ostream& theStream)
: myIStream (NULL), myOStream (&theStream), myInitPos (theStream.tellp()) {}
//! Get io object.
FreeImageIO GetFiIO() const
{
@@ -147,15 +143,12 @@ namespace
if (myIStream != NULL)
{
anIo.read_proc = readProc;
anIo.seek_proc = seekProcIn;
anIo.tell_proc = tellProcIn;
anIo.seek_proc = seekProc;
anIo.tell_proc = tellProc;
}
if (myOStream != NULL)
{
anIo.write_proc = writeProc;
// seek and tell are also used for saving in some formats (.tif for example)
anIo.seek_proc = seekProcOut;
anIo.tell_proc = tellProcOut;
}
return anIo;
}
@@ -190,7 +183,7 @@ namespace
}
//! Simulate fseek().
static int DLL_CALLCONV seekProcIn (fi_handle theHandle, long theOffset, int theOrigin)
static int DLL_CALLCONV seekProc (fi_handle theHandle, long theOffset, int theOrigin)
{
Image_FreeImageStream* aThis = (Image_FreeImageStream* )theHandle;
if (aThis->myIStream == NULL)
@@ -223,53 +216,13 @@ namespace
return isSeekDone ? 0 : -1;
}
static int DLL_CALLCONV seekProcOut (fi_handle theHandle, long theOffset, int theOrigin)
{
Image_FreeImageStream* aThis = (Image_FreeImageStream* )theHandle;
if (aThis->myOStream == NULL)
{
return -1;
}
bool isSeekDone = false;
switch (theOrigin)
{
case SEEK_SET:
if (aThis->myOStream->seekp ((std::streamoff )aThis->myInitPos + theOffset, std::ios::beg))
{
isSeekDone = true;
}
break;
case SEEK_CUR:
if (aThis->myOStream->seekp (theOffset, std::ios::cur))
{
isSeekDone = true;
}
break;
case SEEK_END:
if (aThis->myOStream->seekp (theOffset, std::ios::end))
{
isSeekDone = true;
}
break;
}
return isSeekDone ? 0 : -1;
}
//! Simulate ftell().
static long DLL_CALLCONV tellProcIn (fi_handle theHandle)
static long DLL_CALLCONV tellProc (fi_handle theHandle)
{
Image_FreeImageStream* aThis = (Image_FreeImageStream* )theHandle;
const long aPos = aThis->myIStream != NULL ? (long )(aThis->myIStream->tellg() - aThis->myInitPos) : 0;
return aPos;
}
static long DLL_CALLCONV tellProcOut (fi_handle theHandle)
{
Image_FreeImageStream* aThis = (Image_FreeImageStream* )theHandle;
const long aPos = aThis->myOStream != NULL ? (long )(aThis->myOStream->tellp() - aThis->myInitPos) : 0;
return aPos;
}
private:
std::istream* myIStream;
std::ostream* myOStream;
@@ -285,37 +238,6 @@ namespace
return aGuid;
}
//! Returns GUID of image format from file name
static GUID getFileFormatFromName (const TCollection_AsciiString& theFileName)
{
TCollection_AsciiString aFileNameLower = theFileName;
aFileNameLower.LowerCase();
GUID aFileFormat = getNullGuid();
if (aFileNameLower.EndsWith (".bmp"))
{
aFileFormat = GUID_ContainerFormatBmp;
}
else if (aFileNameLower.EndsWith (".png"))
{
aFileFormat = GUID_ContainerFormatPng;
}
else if (aFileNameLower.EndsWith (".jpg")
|| aFileNameLower.EndsWith (".jpeg"))
{
aFileFormat = GUID_ContainerFormatJpeg;
}
else if (aFileNameLower.EndsWith (".tiff")
|| aFileNameLower.EndsWith (".tif"))
{
aFileFormat = GUID_ContainerFormatTiff;
}
else if (aFileNameLower.EndsWith (".gif"))
{
aFileFormat = GUID_ContainerFormatGif;
}
return aFileFormat;
}
//! Sentry over IUnknown pointer.
template<class T> class Image_ComPtr
{
@@ -424,11 +346,7 @@ namespace
// purpose :
// =======================================================================
Image_AlienPixMap::Image_AlienPixMap()
#ifdef HAVE_WINCODEC
: myPalette (NULL)
#else
: myLibImage (NULL)
#endif
{
SetTopDown (false);
}
@@ -587,12 +505,6 @@ void Image_AlienPixMap::Clear()
FreeImage_Unload (myLibImage);
myLibImage = NULL;
}
#elif defined(HAVE_WINCODEC)
if (myPalette != NULL)
{
myPalette->Release();
myPalette = NULL;
}
#elif defined(__EMSCRIPTEN__)
if (myLibImage != NULL)
{
@@ -623,7 +535,7 @@ bool Image_AlienPixMap::IsTopDownDefault()
// =======================================================================
#ifdef HAVE_FREEIMAGE
bool Image_AlienPixMap::Load (const Standard_Byte* theData,
const Standard_Size theLength,
Standard_Size theLength,
const TCollection_AsciiString& theImagePath)
{
Clear();
@@ -793,7 +705,7 @@ bool Image_AlienPixMap::Load (std::istream& theStream,
#elif defined(HAVE_WINCODEC)
bool Image_AlienPixMap::Load (const Standard_Byte* theData,
const Standard_Size theLength,
Standard_Size theLength,
const TCollection_AsciiString& theFileName)
{
Clear();
@@ -839,7 +751,7 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
|| aFrameCount < 1
|| aWicDecoder->GetFrame (0, &aWicFrameDecode.ChangePtr()) != S_OK
|| aWicFrameDecode->GetSize (&aFrameSizeX, &aFrameSizeY) != S_OK
|| aWicFrameDecode->GetPixelFormat (&aWicPixelFormat) != S_OK)
|| aWicFrameDecode->GetPixelFormat (&aWicPixelFormat))
{
Message::SendFail ("Error: cannot get WIC Image Frame");
return false;
@@ -856,6 +768,7 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
Message::SendFail ("Error: cannot convert WIC Image Frame to RGB format");
return false;
}
aWicFrameDecode.Nullify();
}
if (!Image_PixMap::InitTrash (aPixelFormat, aFrameSizeX, aFrameSizeY))
@@ -864,37 +777,17 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
return false;
}
TCollection_AsciiString aFileNameLower = theFileName;
aFileNameLower.LowerCase();
if (aFileNameLower.EndsWith (".gif")
&& (aWicImgFactory->CreatePalette (&myPalette) != S_OK
|| aWicFrameDecode->CopyPalette (myPalette) != S_OK))
{
Message::SendFail ("Error: cannot get palette for GIF image");
return false;
}
IWICBitmapSource* aWicSrc = aWicFrameDecode.get();
if(!aWicConvertedFrame.IsNull())
{
aWicSrc = aWicConvertedFrame.get();
}
IWICBitmapFlipRotator* aRotator;
bool isTopDown = true;
if (aWicImgFactory->CreateBitmapFlipRotator (&aRotator) == S_OK
&& aRotator->Initialize (aWicSrc, WICBitmapTransformFlipVertical) == S_OK)
{
isTopDown = false;
aWicSrc = aRotator;
}
if (aWicSrc->CopyPixels (NULL, (UINT )SizeRowBytes(), (UINT )SizeBytes(), ChangeData()) != S_OK)
{
Message::SendFail ("Error: cannot copy pixels from WIC Image");
return false;
}
SetTopDown (isTopDown);
SetTopDown (true);
return true;
}
bool Image_AlienPixMap::Load (std::istream& theStream,
@@ -931,7 +824,7 @@ bool Image_AlienPixMap::Load (std::istream& ,
return false;
}
bool Image_AlienPixMap::Load (const Standard_Byte* theData,
const Standard_Size theLength,
Standard_Size theLength,
const TCollection_AsciiString& theImagePath)
{
Clear();
@@ -964,7 +857,7 @@ bool Image_AlienPixMap::Load (std::istream& ,
return false;
}
bool Image_AlienPixMap::Load (const Standard_Byte* ,
const Standard_Size ,
Standard_Size ,
const TCollection_AsciiString& )
{
Clear();
@@ -1014,52 +907,11 @@ bool Image_AlienPixMap::savePPM (const TCollection_AsciiString& theFileName) con
return true;
}
// =======================================================================
// function : convertData
// purpose :
// =======================================================================
#ifdef HAVE_WINCODEC
static bool convertData (const Image_AlienPixMap& theSrcPixMapData,
const WICPixelFormatGUID& theFormat,
IWICImagingFactory& theWicImgFactory,
Image_PixMapData& theDstPixMapData)
{
const UINT aSizeRowBytes = (UINT)theSrcPixMapData.SizeRowBytes();
const UINT aSizeBytes = (UINT)theSrcPixMapData.SizeBytes();
Image_ComPtr<IWICBitmap> anSrcImg;
Image_ComPtr<IWICFormatConverter> aWicFormatConverter;
HRESULT anHResult = theWicImgFactory.CreateBitmapFromMemory ((UINT)theSrcPixMapData.SizeX(), (UINT)theSrcPixMapData.SizeY(),
convertToWicFormat (theSrcPixMapData.Format()),
aSizeRowBytes, aSizeBytes,
(BYTE*)theSrcPixMapData.Data(), &anSrcImg.ChangePtr());
if (anHResult != S_OK
|| theWicImgFactory.CreateFormatConverter (&aWicFormatConverter.ChangePtr()) != S_OK
|| aWicFormatConverter->Initialize (anSrcImg.get(), theFormat, WICBitmapDitherTypeNone, theSrcPixMapData.GetPalette(), 0.0f, WICBitmapPaletteTypeCustom) != S_OK)
{
Message::SendFail ("Error: cannot convert WIC Image Frame to required format");
return false;
}
theDstPixMapData.Init (Image_PixMap::DefaultAllocator(), 1, theSrcPixMapData.SizeXYZ(), aSizeRowBytes, NULL);
if (aWicFormatConverter->CopyPixels (NULL, aSizeRowBytes, aSizeBytes, theDstPixMapData.ChangeData()) != S_OK)
{
Message::SendFail ("Error: cannot copy pixels from WIC Image");
return false;
}
return true;
}
#endif
// =======================================================================
// function : Save
// purpose :
// =======================================================================
bool Image_AlienPixMap::Save (Standard_Byte* theBuffer,
const Standard_Size theLength,
const TCollection_AsciiString& theFileName)
bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
{
#ifdef HAVE_FREEIMAGE
if (myLibImage == NULL)
@@ -1087,399 +939,10 @@ bool Image_AlienPixMap::Save (Standard_Byte* theBuffer,
SetTopDown (false);
}
FIBITMAP* anImageToDump = getImageToDump (anImageFormat);
if (anImageToDump == NULL)
{
return false;
}
bool isSaved = false;
if (theBuffer != NULL)
{
// a memory buffer wrapped by FreeImage is read only (images can be loaded but not be saved)
// so we call FreeImage_OpenMemory() with default arguments and just memcpy in requsted buffer.
FIMEMORY* aFiMem = FreeImage_OpenMemory();
isSaved = (FreeImage_SaveToMemory (anImageFormat, anImageToDump, aFiMem) != FALSE);
BYTE* aData = NULL;
DWORD aSize;
FreeImage_AcquireMemory (aFiMem, &aData, &aSize);
if (aSize > theLength)
{
Message::SendFail ("Error: memory buffer too small for storing image");
return false;
}
memcpy (theBuffer, aData, aSize);
FreeImage_CloseMemory (aFiMem);
}
else
{
#ifdef _WIN32
isSaved = (FreeImage_SaveU (anImageFormat, anImageToDump, aFileNameW.ToWideString ()) != FALSE);
#else
isSaved = (FreeImage_Save (anImageFormat, anImageToDump, theFileName.ToCString ()) != FALSE);
#endif
}
if (anImageToDump != myLibImage)
{
FreeImage_Unload (anImageToDump);
}
return isSaved;
#elif defined(HAVE_WINCODEC)
TCollection_AsciiString aFileNameLower = theFileName;
aFileNameLower.LowerCase();
if (aFileNameLower.EndsWith (".ppm"))
{
return savePPM (theFileName);
}
GUID aFileFormat = getFileFormatFromName (theFileName);
if (aFileFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported image format");
return false;
}
Image_ComPtr<IWICImagingFactory> aWicImgFactory;
CoInitializeEx (NULL, COINIT_MULTITHREADED);
if (CoCreateInstance (CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&aWicImgFactory.ChangePtr())) != S_OK)
{
Message::SendFail ("Error: cannot initialize WIC Imaging Factory");
return false;
}
WICPixelFormatGUID aWicPixelFormat = convertToWicFormat (myImgFormat);
if (aWicPixelFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported pixel format");
return false;
}
Image_PixMapData* aPixMapData = &myData;
Image_PixMapData aConvertedData;
if (aFileFormat == GUID_ContainerFormatGif)
{
aWicPixelFormat = GUID_WICPixelFormat8bppIndexed;
convertData (*this, aWicPixelFormat, *aWicImgFactory, aConvertedData);
aPixMapData = &aConvertedData;
}
Image_ComPtr<IWICStream> aWicStream;
Image_ComPtr<IWICBitmapEncoder> aWicEncoder;
const TCollection_ExtendedString aFileNameW (theFileName);
if (theBuffer != NULL)
{
if (aWicImgFactory->CreateStream (&aWicStream.ChangePtr()) != S_OK
|| aWicStream->InitializeFromMemory (theBuffer,(DWORD )theLength) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Memory Stream");
return false;
}
}
else
{
if (aWicImgFactory->CreateStream (&aWicStream.ChangePtr()) != S_OK
|| aWicStream->InitializeFromFilename (aFileNameW.ToWideString(), GENERIC_WRITE) != S_OK)
{
Message::SendFail ("Error: cannot create WIC File Stream");
return false;
}
}
if (aWicImgFactory->CreateEncoder (aFileFormat, NULL, &aWicEncoder.ChangePtr()) != S_OK
|| aWicEncoder->Initialize (aWicStream.get(), WICBitmapEncoderNoCache) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Encoder");
return false;
}
WICPixelFormatGUID aWicPixelFormatRes = aWicPixelFormat;
Image_ComPtr<IWICBitmapFrameEncode> aWicFrameEncode;
if (aWicEncoder->CreateNewFrame (&aWicFrameEncode.ChangePtr(), NULL) != S_OK
|| aWicFrameEncode->Initialize (NULL) != S_OK
|| aWicFrameEncode->SetSize ((UINT )SizeX(), (UINT )SizeY()) != S_OK
|| aWicFrameEncode->SetPixelFormat (&aWicPixelFormatRes) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Frame");
return false;
}
if (aFileFormat == GUID_ContainerFormatGif
&& (myPalette == NULL
|| aWicFrameEncode->SetPalette (myPalette) != S_OK))
{
Message::SendFail ("Error: cannot set palette");
return false;
}
if (aWicPixelFormatRes != aWicPixelFormat)
{
Message::SendFail ("Error: pixel format is unsupported by image format");
return false;
}
if (IsTopDown())
{
if (aWicFrameEncode->WritePixels ((UINT )SizeY(), (UINT )SizeRowBytes(), (UINT )SizeBytes(), (BYTE* )aPixMapData->Data()) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
else
{
for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow)
{
if (aWicFrameEncode->WritePixels (1, (UINT )SizeRowBytes(), (UINT )SizeRowBytes(), (BYTE* )aPixMapData->Row (aRow)) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
}
if (aWicFrameEncode->Commit() != S_OK
|| aWicEncoder->Commit() != S_OK)
{
Message::SendFail ("Error: cannot commit data to WIC Frame");
return false;
}
if (aWicStream->Commit (STGC_DEFAULT) != S_OK)
{
//Message::Send ("Error: cannot commit data to WIC File Stream", Message_Fail);
//return false;
}
return true;
#else
if (theBuffer != NULL)
{
Message::SendFail ("Error: no image library available");
return false;
}
const Standard_Integer aLen = theFileName.Length();
if ((aLen >= 4) && (theFileName.Value (aLen - 3) == '.')
&& strcasecmp( theFileName.ToCString() + aLen - 3, "ppm") == 0 )
{
return savePPM (theFileName);
}
Message::SendTrace ("Image_PixMap, no image library available! Image saved in PPM format");
return savePPM (theFileName);
#endif
}
bool Image_AlienPixMap::Save (std::ostream& theStream, const TCollection_AsciiString& theExtension)
{
#ifdef HAVE_FREEIMAGE
if (myLibImage == NULL)
{
return false;
}
#ifdef _WIN32
const TCollection_ExtendedString anExtW (theExtension.ToCString(), Standard_True);
FREE_IMAGE_FORMAT anImageFormat = FreeImage_GetFIFFromFilenameU (anExtW.ToWideString());
#else
FREE_IMAGE_FORMAT anImageFormat = FreeImage_GetFIFFromFilename (theExtension.ToCString());
#endif
if (anImageFormat == FIF_UNKNOWN)
{
#ifdef OCCT_DEBUG
std::cerr << "Image_PixMap, image format doesn't supported!\n";
#endif
return false;
}
if (IsTopDown())
{
FreeImage_FlipVertical (myLibImage);
SetTopDown (false);
}
FIBITMAP* anImageToDump = getImageToDump (anImageFormat);
if (anImageToDump == NULL)
{
return false;
}
bool isSaved = false;
Image_FreeImageStream aStream (theStream);
FreeImageIO anIO = aStream.GetFiIO();
isSaved = (FreeImage_SaveToHandle(anImageFormat, anImageToDump, &anIO, &aStream) != FALSE);
if (anImageToDump != myLibImage)
{
FreeImage_Unload (anImageToDump);
}
return isSaved;
#elif defined(HAVE_WINCODEC)
GUID aFileFormat = getFileFormatFromName (theExtension);
if (aFileFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported image format");
return false;
}
Image_ComPtr<IWICImagingFactory> aWicImgFactory;
CoInitializeEx (NULL, COINIT_MULTITHREADED);
if (CoCreateInstance (CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&aWicImgFactory.ChangePtr())) != S_OK)
{
Message::SendFail ("Error: cannot initialize WIC Imaging Factory");
return false;
}
WICPixelFormatGUID aWicPixelFormat = convertToWicFormat (myImgFormat);
if (aWicPixelFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported pixel format");
return false;
}
Image_PixMapData* aPixMapData = &myData;
Image_PixMapData aConvertedData;
if (aFileFormat == GUID_ContainerFormatGif)
{
aWicPixelFormat = GUID_WICPixelFormat8bppIndexed;
convertData (*this, aWicPixelFormat, *aWicImgFactory, aConvertedData);
aPixMapData = &aConvertedData;
}
Image_ComPtr<IStream> aStream;
Image_ComPtr<IWICBitmapEncoder> aWicEncoder;
if (CreateStreamOnHGlobal (NULL, Standard_True, &aStream.ChangePtr()) != S_OK)
{
Message::SendFail ("Error: cannot create Stream on global");
return false;
}
if (aWicImgFactory->CreateEncoder (aFileFormat, NULL, &aWicEncoder.ChangePtr()) != S_OK
|| aWicEncoder->Initialize (aStream.get(), WICBitmapEncoderNoCache) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Encoder");
return false;
}
WICPixelFormatGUID aWicPixelFormatRes = aWicPixelFormat;
Image_ComPtr<IWICBitmapFrameEncode> aWicFrameEncode;
if (aWicEncoder->CreateNewFrame (&aWicFrameEncode.ChangePtr(), NULL) != S_OK
|| aWicFrameEncode->Initialize (NULL) != S_OK
|| aWicFrameEncode->SetSize ((UINT )SizeX(), (UINT )SizeY()) != S_OK
|| aWicFrameEncode->SetPixelFormat (&aWicPixelFormatRes) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Frame");
return false;
}
if (aFileFormat == GUID_ContainerFormatGif
&& (myPalette == NULL
|| aWicFrameEncode->SetPalette (myPalette) != S_OK))
{
Message::SendFail ("Error: cannot set palette");
return false;
}
if (aWicPixelFormatRes != aWicPixelFormat)
{
Message::SendFail ("Error: pixel format is unsupported by image format");
return false;
}
if (IsTopDown())
{
if (aWicFrameEncode->WritePixels ((UINT )SizeY(), (UINT )SizeRowBytes(), (UINT )SizeBytes(), (BYTE* )aPixMapData->Data()) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
else
{
for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow)
{
if (aWicFrameEncode->WritePixels (1, (UINT )SizeRowBytes(), (UINT )SizeRowBytes(), (BYTE* )aPixMapData->Row (aRow)) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
}
if (aWicFrameEncode->Commit() != S_OK
|| aWicEncoder->Commit() != S_OK)
{
Message::SendFail ("Error: cannot commit data to WIC Frame");
return false;
}
if (aStream->Commit (STGC_DEFAULT) != S_OK)
{
//Message::Send ("Error: cannot commit data to Stream", Message_Fail);
//return false;
}
// WIC doesn't have the way to encode image directly in std::ostream
// so we use a workaround to transfer data from IStream to std::ostream
STATSTG aStat;
if (aStream->Stat (&aStat, STATFLAG_NONAME) != S_OK)
{
Message::SendFail ("Error: cannot get stat from stream");
return false;
}
HGLOBAL aMem;
if (GetHGlobalFromStream (aStream.get(), &aMem) != S_OK)
{
Message::SendFail ("Error: cannot get global from stream");
return false;
}
LPVOID aData = GlobalLock (aMem);
if (aData == NULL)
{
Message::SendFail ("Error: cannot lock global");
return false;
}
if (!theStream.write ((const char* )aData, aStat.cbSize.QuadPart))
{
Message::SendFail ("Error: cannot write data to ostream");
return false;
}
if (GlobalUnlock (aMem) == 0 && GetLastError() != NO_ERROR)
{
Message::SendFail ("Error: cannot unlock global");
return false;
}
return true;
#else
Message::SendFail ("Error: no image library available");
return false;
#endif
}
// =======================================================================
// function : AdjustGamma
// purpose :
// =======================================================================
bool Image_AlienPixMap::AdjustGamma (const Standard_Real theGammaCorr)
{
#ifdef HAVE_FREEIMAGE
return FreeImage_AdjustGamma (myLibImage, theGammaCorr) != FALSE;
#else
(void )theGammaCorr;
return false;
#endif
}
#ifdef HAVE_FREEIMAGE
// =======================================================================
// function : GetImageToDump
// purpose :
// =======================================================================
FIBITMAP* Image_AlienPixMap::getImageToDump (const Standard_Integer theFormat)
{
FIBITMAP* anImageToDump = myLibImage;
// FreeImage doesn't provide flexible format conversion API
// so we should perform multiple conversions in some cases!
switch (theFormat)
FIBITMAP* anImageToDump = myLibImage;
switch (anImageFormat)
{
case FIF_PNG:
case FIF_BMP:
@@ -1510,7 +973,7 @@ FIBITMAP* Image_AlienPixMap::getImageToDump (const Standard_Integer theFormat)
aTmpBitmap = FreeImage_ConvertToType (myLibImage, FIT_BITMAP);
if (aTmpBitmap == NULL)
{
return NULL;
return false;
}
}
@@ -1523,7 +986,7 @@ FIBITMAP* Image_AlienPixMap::getImageToDump (const Standard_Integer theFormat)
}
if (aTmpBitmap24 == NULL)
{
return NULL;
return false;
}
aTmpBitmap = aTmpBitmap24;
}
@@ -1568,7 +1031,7 @@ FIBITMAP* Image_AlienPixMap::getImageToDump (const Standard_Integer theFormat)
anImageToDump = FreeImage_ConvertToType (myLibImage, FIT_BITMAP);
if (anImageToDump == NULL)
{
return NULL;
return false;
}
}
@@ -1581,13 +1044,170 @@ FIBITMAP* Image_AlienPixMap::getImageToDump (const Standard_Integer theFormat)
}
if (aTmpBitmap24 == NULL)
{
return NULL;
return false;
}
anImageToDump = aTmpBitmap24;
}
break;
}
}
return anImageToDump;
}
if (anImageToDump == NULL)
{
return false;
}
#ifdef _WIN32
bool isSaved = (FreeImage_SaveU (anImageFormat, anImageToDump, aFileNameW.ToWideString()) != FALSE);
#else
bool isSaved = (FreeImage_Save (anImageFormat, anImageToDump, theFileName.ToCString()) != FALSE);
#endif
if (anImageToDump != myLibImage)
{
FreeImage_Unload (anImageToDump);
}
return isSaved;
#elif defined(HAVE_WINCODEC)
TCollection_AsciiString aFileNameLower = theFileName;
aFileNameLower.LowerCase();
GUID aFileFormat = getNullGuid();
if (aFileNameLower.EndsWith (".ppm"))
{
return savePPM (theFileName);
}
else if (aFileNameLower.EndsWith (".bmp"))
{
aFileFormat = GUID_ContainerFormatBmp;
}
else if (aFileNameLower.EndsWith (".png"))
{
aFileFormat = GUID_ContainerFormatPng;
}
else if (aFileNameLower.EndsWith (".jpg")
|| aFileNameLower.EndsWith (".jpeg"))
{
aFileFormat = GUID_ContainerFormatJpeg;
}
else if (aFileNameLower.EndsWith (".tiff")
|| aFileNameLower.EndsWith (".tif"))
{
aFileFormat = GUID_ContainerFormatTiff;
}
else if (aFileNameLower.EndsWith (".gif"))
{
aFileFormat = GUID_ContainerFormatGif;
}
if (aFileFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported image format");
return false;
}
Image_ComPtr<IWICImagingFactory> aWicImgFactory;
CoInitializeEx (NULL, COINIT_MULTITHREADED);
if (CoCreateInstance (CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&aWicImgFactory.ChangePtr())) != S_OK)
{
Message::SendFail ("Error: cannot initialize WIC Imaging Factory");
return false;
}
Image_ComPtr<IWICStream> aWicFileStream;
Image_ComPtr<IWICBitmapEncoder> aWicEncoder;
const TCollection_ExtendedString aFileNameW (theFileName);
if (aWicImgFactory->CreateStream (&aWicFileStream.ChangePtr()) != S_OK
|| aWicFileStream->InitializeFromFilename (aFileNameW.ToWideString(), GENERIC_WRITE) != S_OK)
{
Message::SendFail ("Error: cannot create WIC File Stream");
return false;
}
if (aWicImgFactory->CreateEncoder (aFileFormat, NULL, &aWicEncoder.ChangePtr()) != S_OK
|| aWicEncoder->Initialize (aWicFileStream.get(), WICBitmapEncoderNoCache) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Encoder");
return false;
}
const WICPixelFormatGUID aWicPixelFormat = convertToWicFormat (myImgFormat);
if (aWicPixelFormat == getNullGuid())
{
Message::SendFail ("Error: unsupported pixel format");
return false;
}
WICPixelFormatGUID aWicPixelFormatRes = aWicPixelFormat;
Image_ComPtr<IWICBitmapFrameEncode> aWicFrameEncode;
if (aWicEncoder->CreateNewFrame (&aWicFrameEncode.ChangePtr(), NULL) != S_OK
|| aWicFrameEncode->Initialize (NULL) != S_OK
|| aWicFrameEncode->SetSize ((UINT )SizeX(), (UINT )SizeY()) != S_OK
|| aWicFrameEncode->SetPixelFormat (&aWicPixelFormatRes) != S_OK)
{
Message::SendFail ("Error: cannot create WIC Frame");
return false;
}
if (aWicPixelFormatRes != aWicPixelFormat)
{
Message::SendFail ("Error: pixel format is unsupported by image format");
return false;
}
if (IsTopDown())
{
if (aWicFrameEncode->WritePixels ((UINT )SizeY(), (UINT )SizeRowBytes(), (UINT )SizeBytes(), (BYTE* )Data()) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
else
{
for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow)
{
if (aWicFrameEncode->WritePixels (1, (UINT )SizeRowBytes(), (UINT )SizeRowBytes(), (BYTE* )Row (aRow)) != S_OK)
{
Message::SendFail ("Error: cannot write pixels to WIC Frame");
return false;
}
}
}
if (aWicFrameEncode->Commit() != S_OK
|| aWicEncoder->Commit() != S_OK)
{
Message::SendFail ("Error: cannot commit data to WIC Frame");
return false;
}
if (aWicFileStream->Commit (STGC_DEFAULT) != S_OK)
{
//Message::Send ("Error: cannot commit data to WIC File Stream", Message_Fail);
//return false;
}
return true;
#else
const Standard_Integer aLen = theFileName.Length();
if ((aLen >= 4) && (theFileName.Value (aLen - 3) == '.')
&& strcasecmp( theFileName.ToCString() + aLen - 3, "ppm") == 0 )
{
return savePPM (theFileName);
}
Message::SendTrace ("Image_PixMap, no image library available! Image saved in PPM format");
return savePPM (theFileName);
#endif
}
// =======================================================================
// function : AdjustGamma
// purpose :
// =======================================================================
bool Image_AlienPixMap::AdjustGamma (const Standard_Real theGammaCorr)
{
#ifdef HAVE_FREEIMAGE
return FreeImage_AdjustGamma (myLibImage, theGammaCorr) != FALSE;
#else
(void )theGammaCorr;
return false;
#endif
}

View File

@@ -19,7 +19,6 @@
#include <Image_PixMap.hxx>
class TCollection_AsciiString;
struct IWICPalette;
struct FIBITMAP;
//! Image class that support file reading/writing operations using auxiliary image library.
@@ -58,41 +57,21 @@ public:
const TCollection_AsciiString& theFileName);
//! Read image data from memory buffer.
//! @param[in] theData memory pointer to read from;
//! when NULL, function will attempt to open theFileName file
//! @param[in] theLength memory buffer length
//! @param[in] theFileName optional file name
//! @param theData memory pointer to read from;
//! when NULL, function will attempt to open theFileName file
//! @param theLength memory buffer length
//! @param theFileName optional file name
Standard_EXPORT bool Load (const Standard_Byte* theData,
const Standard_Size theLength,
Standard_Size theLength,
const TCollection_AsciiString& theFileName);
//! Write image data to file.
//! @param[in] theFileName file name to save
bool Save (const TCollection_AsciiString& theFileName)
{
return Save (NULL, 0, theFileName);
}
//! Write image data to stream.
//! @param[out] theStream stream where to write
//! @param[in] theExtension image format
Standard_EXPORT bool Save (std::ostream& theStream,
const TCollection_AsciiString& theExtension);
//! Write image data to file or memory buffer using file extension to determine format.
//! @param[out] theBuffer buffer pointer where to write
//! when NULL, function write image data to theFileName file
//! @param[in] theLength memory buffer length
//! @param[in] theFileName file name to save;
//! when theBuffer isn't NULL used only to determine format
Standard_EXPORT bool Save (Standard_Byte* theBuffer,
const Standard_Size theLength,
const TCollection_AsciiString& theFileName);
//! Write image data to file using file extension to determine compression format.
Standard_EXPORT bool Save (const TCollection_AsciiString& theFileName);
//! Initialize image plane with required dimensions.
//! @param[in] thePixelFormat if specified pixel format doesn't supported by image library
//! than nearest supported will be used instead!
//! @param[in] theSizeRowBytes may be ignored by this class and required alignment will be used instead!
//! thePixelFormat - if specified pixel format doesn't supported by image library
//! than nearest supported will be used instead!
//! theSizeRowBytes - may be ignored by this class and required alignment will be used instead!
Standard_EXPORT virtual bool InitTrash (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
@@ -105,13 +84,12 @@ public:
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
//! Performs gamma correction on image.
//! @param[in] theGamma - gamma value to use; a value of 1.0 leaves the image alone
//! theGamma - gamma value to use; a value of 1.0 leaves the image alone
Standard_EXPORT bool AdjustGamma (const Standard_Real theGammaCorr);
#if !defined(HAVE_FREEIMAGE) && defined(_WIN32)
//! Returns image palette.
IWICPalette* GetPalette() const { return myPalette; }
#endif
private:
FIBITMAP* myLibImage;
private:
@@ -130,13 +108,6 @@ private:
//! Built-in PPM export
Standard_EXPORT bool savePPM (const TCollection_AsciiString& theFileName) const;
FIBITMAP* getImageToDump (const Standard_Integer theFormat);
private:
FIBITMAP* myLibImage;
IWICPalette* myPalette;
};
DEFINE_STANDARD_HANDLE(Image_AlienPixMap, Image_PixMap)

View File

@@ -224,7 +224,7 @@ const gp_Pnt &IntTools_SurfaceRangeLocalizeData::GetPointInFrame
Standard_Integer aFrmUInd = theUIndex + myUIndMin - 1;
Standard_Integer aFrmVInd = theVIndex + myVIndMin - 1;
if (myGridPoints.IsNull() || aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
if (aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
return gp::Origin();
return myGridPoints->Value(aFrmUInd, aFrmVInd);
@@ -235,7 +235,7 @@ Standard_Real IntTools_SurfaceRangeLocalizeData::GetUParamInFrame
{
Standard_Integer aFrmInd = theIndex + myUIndMin - 1;
if (myUParams.IsNull() || aFrmInd > myUIndMax)
if (aFrmInd > myUIndMax)
return Precision::Infinite();
return myUParams->Value(aFrmInd);
@@ -246,7 +246,7 @@ Standard_Real IntTools_SurfaceRangeLocalizeData::GetVParamInFrame
{
Standard_Integer aFrmInd = theIndex + myVIndMin - 1;
if (myVParams.IsNull() || aFrmInd > myVIndMax)
if (aFrmInd > myVIndMax)
return Precision::Infinite();
return myVParams->Value(aFrmInd);

View File

@@ -387,11 +387,11 @@ static Standard_Integer OCC361bug (Draw_Interpretor& di, Standard_Integer nb, co
//function : OCC30182
//purpose : Testing different interfaces of Image_AlienPixMap::Load()
//=======================================================================
static Standard_Integer OCC30182 (Draw_Interpretor& di, Standard_Integer theNbArgs, const char** theArgVec)
static Standard_Integer OCC30182 (Draw_Interpretor& , Standard_Integer theNbArgs, const char** theArgVec)
{
if (ViewerTest::CurrentView().IsNull())
{
di << "Error: no active view\n";
std::cout << "Error: no active view\n";
return 1;
}
@@ -430,13 +430,13 @@ static Standard_Integer OCC30182 (Draw_Interpretor& di, Standard_Integer theNbAr
}
else
{
di << "Syntax error at '" << anArg << "'\n";
std::cout << "Syntax error at '" << anArg << "'\n";
return 1;
}
}
if (anImgPath.IsEmpty())
{
di << "Syntax error: wrong number of arguments\n";
std::cout << "Syntax error: wrong number of arguments\n";
return 1;
}
@@ -454,7 +454,7 @@ static Standard_Integer OCC30182 (Draw_Interpretor& di, Standard_Integer theNbAr
std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (anImgPath, std::ios::in | std::ios::binary);
if (aFile.get() == NULL)
{
di << "Syntax error: image file '" << anImgPath << "' cannot be found\n";
std::cout << "Syntax error: image file '" << anImgPath << "' cannot be found\n";
return 1;
}
if (anOffset != 0)
@@ -469,13 +469,13 @@ static Standard_Integer OCC30182 (Draw_Interpretor& di, Standard_Integer theNbAr
aFile->seekg (anOffset);
if (aLen <= 0)
{
di << "Syntax error: wrong offset\n";
std::cout << "Syntax error: wrong offset\n";
return 1;
}
NCollection_Array1<Standard_Byte> aBuff (1, aLen);
if (!aFile->read ((char* )&aBuff.ChangeFirst(), aBuff.Size()))
{
di << "Error: unable to read file\n";
std::cout << "Error: unable to read file\n";
return 1;
}
if (!anImage->Load (&aBuff.ChangeFirst(), aBuff.Size(), anImgPath))
@@ -510,107 +510,6 @@ static Standard_Integer OCC30182 (Draw_Interpretor& di, Standard_Integer theNbAr
return 0;
}
//=======================================================================
//function : OCC31956
//purpose : Testing Image_AlienPixMap::Save() overload for saving into a memory buffer or stream
//=======================================================================
static Standard_Integer OCC31956 (Draw_Interpretor& di, Standard_Integer theNbArgs, const char** theArgVec)
{
if (ViewerTest::CurrentView().IsNull())
{
di << "Error: no active view\n";
return 1;
}
if (theNbArgs != 3 && theNbArgs != 5)
{
di << "Syntax error: wrong number of arguments\n";
return 1;
}
bool useStream = false;
TCollection_AsciiString aTempImgPath;
if (theNbArgs == 5)
{
TCollection_AsciiString anArg (theArgVec[3]);
anArg.LowerCase();
if (anArg == "-stream")
{
useStream = true;
aTempImgPath = theArgVec[4];
}
else
{
di << "Syntax error at '" << anArg << "'\n";
return 1;
}
}
TCollection_AsciiString aPrsName, anImgPath;
aPrsName = theArgVec[1];
anImgPath = theArgVec[2];
Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap();
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFile = aFileSystem->OpenIStream (anImgPath, std::ios::in | std::ios::binary);
if (aFile.get() == NULL)
{
di << "Syntax error: image file '" << anImgPath << "' cannot be found\n";
return 1;
}
aFile->seekg (0, std::ios::end);
Standard_Integer aLen = (Standard_Integer )aFile->tellg();
aFile->seekg (0);
if (!anImage->Load (*aFile, anImgPath))
{
return 0;
}
Handle(Image_AlienPixMap) aControlImg = new Image_AlienPixMap();
if (useStream)
{
opencascade::std::shared_ptr<std::ostream> aTempFile = aFileSystem->OpenOStream (aTempImgPath, std::ios::out | std::ios::binary);
if (aTempFile.get() == NULL)
{
di << "Error: image file '" << aTempImgPath << "' cannot be open\n";
return 0;
}
if (!anImage->Save (*aTempFile, aTempImgPath))
{
di << "Error: failed saving file using stream '" << aTempImgPath << "'\n";
return 0;
}
aTempFile.reset();
aControlImg->Load (aTempImgPath);
}
else
{
NCollection_Array1<Standard_Byte> aBuff (1, aLen + 2048);
if (!anImage->Save (&aBuff.ChangeFirst(), aBuff.Size(), anImgPath))
{
di << "Error: failed saving file using buffer'" << anImgPath << "'\n";
return 0;
}
aControlImg->Load (&aBuff.ChangeFirst(), aBuff.Size(), anImgPath);
}
TopoDS_Shape aShape = BRepPrimAPI_MakeBox (100.0 * aControlImg->Ratio(), 100.0, 1.0).Shape();
Handle(AIS_Shape) aPrs = new AIS_Shape (aShape);
aPrs->SetDisplayMode (AIS_Shaded);
aPrs->Attributes()->SetupOwnShadingAspect();
const Handle(Graphic3d_AspectFillArea3d)& anAspect = aPrs->Attributes()->ShadingAspect()->Aspect();
anAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
anAspect->SetTextureMapOn (true);
anAspect->SetTextureMap (new Graphic3d_Texture2D(aControlImg));
if (aControlImg->IsTopDown())
{
anAspect->TextureMap()->GetParams()->SetTranslation (Graphic3d_Vec2 (0.0f, -1.0f));
anAspect->TextureMap()->GetParams()->SetScale (Graphic3d_Vec2 (1.0f, -1.0f));
}
ViewerTest::Display (aPrsName, aPrs, true, true);
return 0;
}
void QABugs::Commands_1(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
@@ -628,7 +527,5 @@ void QABugs::Commands_1(Draw_Interpretor& theCommands) {
theCommands.Add ("OCC30182",
"OCC30182 name image [-offset Start] [-fileName] [-stream] [-memory]\n"
"Decodes image either by passing file name, file stream or memory stream", __FILE__, OCC30182, group);
theCommands.Add ("OCC31956", "OCC31956 name image [-stream tempImage]\n"
"Loads image and saves it into memory buffer or stream then loads it back", __FILE__, OCC31956, group);
return;
}

View File

@@ -27,7 +27,6 @@
#include <Standard_Real.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray2OfInteger.hxx>
#include <TColStd_HArray1OfTransient.hxx>
//=======================================================================
//function : RWStepVisual_RWComplexTriangulatedSurfaceSet
@@ -107,16 +106,15 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep(
}
}
Handle(TColStd_HArray1OfTransient) aTriangleStrips;
Handle(TColStd_HArray2OfInteger) aTriangleStrips;
Standard_Integer sub6 = 0;
if (theData->ReadSubList(theNum, 6, "triangle_strips", theCheck, sub6))
{
Standard_Integer nb0 = theData->NbParams(sub6);
aTriangleStrips = new TColStd_HArray1OfTransient(1, nb0);
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub6,1));
aTriangleStrips = new TColStd_HArray2OfInteger(1, nb0, 1, nbj0);
for (Standard_Integer i0 = 1; i0 <= nb0; i0++)
{
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub6, i0));
Handle(TColStd_HArray1OfInteger) aSingleTriangleStrip = new TColStd_HArray1OfInteger(1, nbj0);
Standard_Integer subj6 = 0;
if ( theData->ReadSubList (sub6, i0, "sub-part(triangle_strips)", theCheck, subj6) ) {
Standard_Integer num4 = subj6;
@@ -124,23 +122,21 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep(
{
Standard_Integer anIt0;
theData->ReadInteger(num4, j0, "integer", theCheck, anIt0);
aSingleTriangleStrip->SetValue(j0, anIt0);
aTriangleStrips->SetValue(i0,j0, anIt0);
}
aTriangleStrips->SetValue(i0, aSingleTriangleStrip);
}
}
}
Handle(TColStd_HArray1OfTransient) aTriangleFans;
Handle(TColStd_HArray2OfInteger) aTriangleFans;
Standard_Integer sub7 = 0;
if (theData->ReadSubList(theNum, 7, "triangle_fans", theCheck, sub7))
{
Standard_Integer nb0 = theData->NbParams(sub7);
aTriangleFans = new TColStd_HArray1OfTransient(1, nb0);
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub7,1));
aTriangleFans = new TColStd_HArray2OfInteger(1, nb0, 1, nbj0);
for (Standard_Integer i0 = 1; i0 <= nb0; i0++)
{
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub7, i0));
Handle(TColStd_HArray1OfInteger) aSingleTriangleFan = new TColStd_HArray1OfInteger(1, nbj0);
Standard_Integer subj7 = 0;
if ( theData->ReadSubList (sub7, i0, "sub-part(triangle_fans)", theCheck, subj7) ) {
Standard_Integer num4 = subj7;
@@ -148,9 +144,8 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep(
{
Standard_Integer anIt0;
theData->ReadInteger(num4, j0, "integer", theCheck, anIt0);
aSingleTriangleFan->SetValue(j0, anIt0);
aTriangleFans->SetValue(i0,j0, anIt0);
}
aTriangleFans->SetValue(i0, aSingleTriangleFan);
}
}
}
@@ -204,14 +199,13 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::WriteStep(
theSW.CloseSub();
theSW.OpenSub();
for (Standard_Integer i5 = 1; i5 <= theEnt->NbTriangleStrips(); i5++)
for (Standard_Integer i5 = 1; i5 <= theEnt->TriangleStrips()->RowLength(); i5++)
{
theSW.NewLine(Standard_False);
theSW.OpenSub();
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(theEnt->TriangleStrips()->Value(i5));
for (Standard_Integer j5 = 1; j5 <= aTriangleStrip->Length(); j5++)
for (Standard_Integer j5 = 1; j5 <= theEnt->TriangleStrips()->ColLength(); j5++)
{
Standard_Integer Var0 = aTriangleStrip->Value(j5);
Standard_Integer Var0 = theEnt->TriangleStrips()->Value(i5,j5);
theSW.Send(Var0);
}
theSW.CloseSub();
@@ -219,14 +213,13 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::WriteStep(
theSW.CloseSub();
theSW.OpenSub();
for (Standard_Integer i6 = 1; i6 <= theEnt->NbTriangleFans(); i6++)
for (Standard_Integer i6 = 1; i6 <= theEnt->TriangleFans()->RowLength(); i6++)
{
theSW.NewLine(Standard_False);
theSW.OpenSub();
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(theEnt->TriangleFans()->Value(i6));
for (Standard_Integer j6 = 1; j6 <= aTriangleFan->Length(); j6++)
for (Standard_Integer j6 = 1; j6 <= theEnt->TriangleFans()->ColLength(); j6++)
{
Standard_Integer Var0 = aTriangleFan->Value(j6);
Standard_Integer Var0 = theEnt->TriangleFans()->Value(i6,j6);
theSW.Send(Var0);
}
theSW.CloseSub();

View File

@@ -39,13 +39,9 @@ STEPCAFControl_Controller::STEPCAFControl_Controller ()
Standard_Boolean STEPCAFControl_Controller::Init ()
{
static Standard_Mutex theMutex;
{
Standard_Mutex::Sentry aSentry(theMutex);
static Standard_Boolean inic = Standard_False;
if (inic) return Standard_True;
inic = Standard_True;
}
static Standard_Boolean inic = Standard_False;
if (inic) return Standard_True;
inic = Standard_True;
// self-registering
Handle(STEPCAFControl_Controller) STEPCTL = new STEPCAFControl_Controller;
// do XSAlgo::Init, cause it does not called before.

View File

@@ -1309,7 +1309,6 @@ Handle(TCollection_HAsciiString) STEPCAFControl_GDTProperty::GetTolValueType(con
//=======================================================================
Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessellation(const TopoDS_Shape& theShape)
{
Handle(StepVisual_TessellatedGeometricSet) aGeomSet;
// Build coordinate list and curves
NCollection_Handle<StepVisual_VectorOfHSequenceOfInteger> aCurves = new StepVisual_VectorOfHSequenceOfInteger;
NCollection_Vector<gp_XYZ> aCoords;
@@ -1343,11 +1342,6 @@ Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessel
aCurves->Append(aCurve);
}
if (!aCoords.Length())
{
return aGeomSet;
}
Handle(TColgp_HArray1OfXYZ) aPoints = new TColgp_HArray1OfXYZ(1, aCoords.Length());
for (Standard_Integer i = 1; i <= aPoints->Length(); i++) {
aPoints->SetValue(i, aCoords.Value(i - 1));
@@ -1359,7 +1353,7 @@ Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessel
aCurveSet->Init(new TCollection_HAsciiString(), aCoordList, aCurves);
NCollection_Handle<StepVisual_Array1OfTessellatedItem> aTessItems = new StepVisual_Array1OfTessellatedItem(1, 1);
aTessItems->SetValue(1, aCurveSet);
aGeomSet = new StepVisual_TessellatedGeometricSet();
Handle(StepVisual_TessellatedGeometricSet) aGeomSet = new StepVisual_TessellatedGeometricSet();
aGeomSet->Init(new TCollection_HAsciiString(), aTessItems);
return aGeomSet;
}

View File

@@ -40,6 +40,7 @@
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepData_GlobalFactors.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
#include <STEPCAFControl_DataMapOfShapePD.hxx>
@@ -54,7 +55,6 @@
#include <STEPControl_Reader.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Direction.hxx>
#include <StepData_Factors.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
#include <StepDimTol_CoaxialityTolerance.hxx>
@@ -219,7 +219,6 @@
#include <StepVisual_TessellatedAnnotationOccurrence.hxx>
#include <StepVisual_TessellatedGeometricSet.hxx>
#include <StepVisual_TessellatedCurveSet.hxx>
#include <StepVisual_ComplexTriangulatedSurfaceSet.hxx>
#include <StepVisual_CoordinatesList.hxx>
#include <NCollection_Vector.hxx>
#include <StepVisual_OverRidingStyledItem.hxx>
@@ -500,8 +499,7 @@ static void FillShapesMap(const TopoDS_Shape &S, TopTools_MapOfShape &map)
//purpose :
//=======================================================================
void STEPCAFControl_Reader::prepareUnits(const Handle(StepData_StepModel)& theModel,
const Handle(TDocStd_Document)& theDoc,
StepData_Factors& theLocalFactors) const
const Handle(TDocStd_Document)& theDoc) const
{
Standard_Real aScaleFactorMM = 1.;
if (!XCAFDoc_DocumentTool::GetLengthUnit(theDoc, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
@@ -511,7 +509,6 @@ void STEPCAFControl_Reader::prepareUnits(const Handle(StepData_StepModel)& theMo
// Sets length unit to the document
XCAFDoc_DocumentTool::SetLengthUnit(theDoc, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter);
}
theLocalFactors.SetCascadeUnit(aScaleFactorMM);
theModel->SetLocalLengthUnit(aScaleFactorMM);
}
@@ -529,8 +526,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
{
reader.ClearShapes();
Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(reader.Model());
StepData_Factors aLocalFactors;
prepareUnits(aModel, doc, aLocalFactors);
prepareUnits(aModel, doc);
Standard_Integer i;
// Read all shapes
@@ -696,7 +692,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
// read colors
if (GetColorMode())
ReadColors(reader.WS(), doc, aLocalFactors);
ReadColors(reader.WS(), doc);
// read names
if (GetNameMode())
@@ -704,7 +700,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
// read validation props
if (GetPropsMode())
ReadValProps(reader.WS(), doc, PDFileMap, aLocalFactors);
ReadValProps(reader.WS(), doc, PDFileMap);
// read layers
if (GetLayerMode())
@@ -716,15 +712,15 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
// read GDT entities from STEP model
if (GetGDTMode())
ReadGDTs(reader.WS(), doc, aLocalFactors);
ReadGDTs(reader.WS(), doc);
// read Material entities from STEP model
if (GetMatMode())
ReadMaterials(reader.WS(), doc, SeqPDS, aLocalFactors);
ReadMaterials(reader.WS(), doc, SeqPDS);
// read View entities from STEP model
if (GetViewMode())
ReadViews(reader.WS(), doc, aLocalFactors);
ReadViews(reader.WS(), doc);
// Expand resulting CAF structure for sub-shapes (optionally with their
// names) if requested
@@ -954,8 +950,7 @@ static void propagateColorToParts(const Handle(XCAFDoc_ShapeTool)& theSTool,
static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &theTP,
const Handle(XCAFDoc_ColorTool)& theCTool,
const STEPConstruct_Styles& theStyles,
const Handle(StepVisual_ContextDependentOverRidingStyledItem)& theStyle,
const StepData_Factors& theLocalFactors)
const Handle(StepVisual_ContextDependentOverRidingStyledItem)& theStyle)
{
if (theStyle.IsNull()) return;
@@ -1009,8 +1004,8 @@ static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &t
if(!anAxp1.IsNull() && !anAxp2.IsNull())
{
Handle(Geom_Axis2Placement) anOrig = StepToGeom::MakeAxis2Placement (anAxp1, theLocalFactors);
Handle(Geom_Axis2Placement) aTarg = StepToGeom::MakeAxis2Placement (anAxp2, theLocalFactors);
Handle(Geom_Axis2Placement) anOrig = StepToGeom::MakeAxis2Placement (anAxp1);
Handle(Geom_Axis2Placement) aTarg = StepToGeom::MakeAxis2Placement (anAxp2);
gp_Ax3 anAx3Orig(anOrig->Ax2());
gp_Ax3 anAx3Targ(aTarg->Ax2());
@@ -1061,18 +1056,17 @@ static void SetStyle(const Handle(XSControl_WorkSession) &theWS,
const Handle(XCAFDoc_ShapeTool)& theSTool,
const STEPConstruct_Styles& theStyles,
const Handle(TColStd_HSequenceOfTransient)& theHSeqOfInvisStyle,
const Handle(StepVisual_StyledItem)& theStyle,
const StepData_Factors& theLocalFactors)
const Handle(StepVisual_StyledItem)& theStyle)
{
if (theStyle.IsNull()) return;
const Handle(Transfer_TransientProcess) &aTP = theWS->TransferReader()->TransientProcess();
if (Handle(StepVisual_OverRidingStyledItem) anOverridingStyle = Handle(StepVisual_OverRidingStyledItem)::DownCast (theStyle))
{
SetStyle (theWS, theMap, theCTool, theSTool, theStyles, theHSeqOfInvisStyle, anOverridingStyle->OverRiddenStyle (), theLocalFactors);
SetStyle (theWS, theMap, theCTool, theSTool, theStyles, theHSeqOfInvisStyle, anOverridingStyle->OverRiddenStyle ());
if (Handle(StepVisual_ContextDependentOverRidingStyledItem) anAssemblyComponentStyle = Handle(StepVisual_ContextDependentOverRidingStyledItem)::DownCast (theStyle))
{
SetAssemblyComponentStyle (aTP, theCTool, theStyles,anAssemblyComponentStyle, theLocalFactors);
SetAssemblyComponentStyle (aTP, theCTool, theStyles,anAssemblyComponentStyle);
return;
}
}
@@ -1253,8 +1247,7 @@ static Standard_Boolean IsOverriden(const Interface_Graph& theGraph,
//=======================================================================
Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSession) &WS,
const Handle(TDocStd_Document)& Doc,
const StepData_Factors& theLocalFactors) const
const Handle(TDocStd_Document)& Doc) const
{
STEPConstruct_Styles Styles(WS);
if (!Styles.LoadStyles()) {
@@ -1285,7 +1278,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSe
// check that style is overridden by other root style
if (!IsOverriden (aGraph, Style, anIsRootStyle))
{
SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style, theLocalFactors);
SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style);
}
}
@@ -1298,7 +1291,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSe
// check that style is overridden
if (!IsOverriden (aGraph, Style, anIsRootStyle))
{
SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style, theLocalFactors);
SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style);
}
}
@@ -1497,8 +1490,7 @@ static TDF_Label GetLabelFromPD(const Handle(StepBasic_ProductDefinition) &PD,
Standard_Boolean STEPCAFControl_Reader::ReadValProps(const Handle(XSControl_WorkSession) &WS,
const Handle(TDocStd_Document)& Doc,
const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
const StepData_Factors& theLocalFactors) const
const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const
{
// get starting data
const Handle(XSControl_TransferReader) &TR = WS->TransferReader();
@@ -1611,11 +1603,11 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps(const Handle(XSControl_Work
Standard_Boolean isArea;
Standard_Real val;
gp_Pnt pos;
if (Props.GetPropReal(ent, val, isArea, theLocalFactors)) {
if (Props.GetPropReal(ent, val, isArea)) {
if (isArea) XCAFDoc_Area::Set(L, val);
else XCAFDoc_Volume::Set(L, val);
}
else if (Props.GetPropPnt(ent, rep->ContextOfItems(), pos, theLocalFactors)) {
else if (Props.GetPropPnt(ent, rep->ContextOfItems(), pos)) {
XCAFDoc_Centroid::Set(L, pos);
}
}
@@ -1936,145 +1928,27 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
return Standard_True;
}
// ============================================================================
// Method : createMesh
// Purpose : creates a Poly_Triangulation from ComplexTriangulatedSurfaceSet
// ============================================================================
Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulatedSurfaceSet)& theTriangulatedSufaceSet,
const Standard_Real theFact)
{
Handle(StepVisual_CoordinatesList) aCoords = theTriangulatedSufaceSet->Coordinates();
Handle(TColgp_HArray1OfXYZ) aNodes = aCoords->Points();
Handle(TColStd_HArray1OfTransient) aTriaStrips = theTriangulatedSufaceSet->TriangleStrips();
Handle(TColStd_HArray1OfTransient) aTriaFans = theTriangulatedSufaceSet->TriangleFans();
const Standard_Boolean aHasUVNodes = Standard_False;
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_Boolean aHasNormals = aNbNormals > 0;
// Counting number of triangles in the triangle strips list.
// A triangle strip is a list of 3 or more points defining a set of connected triangles.
Standard_Integer aNbTriaStrips = 0;
for (Standard_Integer i = 1; i <= theTriangulatedSufaceSet->NbTriangleStrips(); ++i)
{
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaStrips->Value(i));
aNbTriaStrips += aTriangleStrip->Length() - 2;
}
// Counting number of triangles in the triangle fans list.
// A triangle fan is a set of 3 or more points defining a set of connected triangles sharing a common vertex.
Standard_Integer aNbTriaFans = 0;
for (Standard_Integer i = 1; i <= theTriangulatedSufaceSet->NbTriangleFans(); ++i)
{
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaFans->Value(i));
aNbTriaFans += aTriangleFan->Length() - 2;
}
Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(aNbPairs, aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
for (Standard_Integer j = 1; j <= aNbPairs; ++j)
{
const gp_XYZ& aPoint = aNodes->Value(aNbNormals > 1 ? theTriangulatedSufaceSet->PnindexValue(j) : j);
aMesh->SetNode(j, theFact * aPoint);
}
// Creating triangles from triangle strips. Processing is split in two parts to
// path through nodes in the same direction.
Standard_Integer k = 1;
for (Standard_Integer i = 1; i <= theTriangulatedSufaceSet->NbTriangleStrips(); ++i)
{
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaStrips->Value(i));
for (Standard_Integer j = 3; j <= aTriangleStrip->Length(); j += 2)
{
if (aTriangleStrip->Value(j) != aTriangleStrip->Value(j - 2) &&
aTriangleStrip->Value(j) != aTriangleStrip->Value(j - 1))
{
aMesh->SetTriangle(k++, Poly_Triangle(aTriangleStrip->Value(j - 2),
aTriangleStrip->Value(j),
aTriangleStrip->Value(j - 1)));
}
}
for (Standard_Integer j = 4; j <= aTriangleStrip->Length(); j += 2)
{
if (aTriangleStrip->Value(j) != aTriangleStrip->Value(j - 2) &&
aTriangleStrip->Value(j) != aTriangleStrip->Value(j - 1))
{
aMesh->SetTriangle(k++, Poly_Triangle(aTriangleStrip->Value(j - 2),
aTriangleStrip->Value(j - 1),
aTriangleStrip->Value(j)));
}
}
}
// Creating triangles from triangle strips.
for (Standard_Integer i = 1; i <= theTriangulatedSufaceSet->NbTriangleFans(); ++i)
{
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaFans->Value(i));
for (Standard_Integer j = 3; j <= aTriangleFan->Length(); ++j)
{
aMesh->SetTriangle(k++, Poly_Triangle(aTriangleFan->Value(1),
aTriangleFan->Value(j - 1),
aTriangleFan->Value(j)));
}
}
if (aHasNormals)
{
Handle(TColStd_HArray2OfReal) aNormals = theTriangulatedSufaceSet->Normals();
gp_XYZ aNorm;
if (theTriangulatedSufaceSet->NbNormals() == 1)
{
aNorm.SetX(aNormals->Value(1, 1));
aNorm.SetY(aNormals->Value(1, 2));
aNorm.SetZ(aNormals->Value(1, 3));
for (Standard_Integer i = 1; i <= aNbPairs; ++i)
{
aMesh->SetNormal(i, aNorm);
}
}
else
{
for (Standard_Integer i = 1; i <= aNbPairs; ++i)
{
aNorm.SetX(aNormals->Value(i, 1));
aNorm.SetY(aNormals->Value(i, 2));
aNorm.SetZ(aNormals->Value(i, 3));
aMesh->SetNormal(i, aNorm);
}
}
}
return aMesh;
}
//=======================================================================
//function : readPMIPresentation
//purpose : read polyline or tessellated presentation for
// (Annotation_Curve_Occurrence or Draughting_Callout)
//=======================================================================
Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresentEntity,
const Handle(XSControl_TransferReader)& theTR,
const Standard_Real theFact,
TopoDS_Shape& thePresentation,
Handle(TCollection_HAsciiString)& thePresentName,
Bnd_Box& theBox,
const StepData_Factors& theLocalFactors)
const Handle(XSControl_TransferReader)& theTR,
const Standard_Real theFact,
TopoDS_Shape& thePresentation,
Handle(TCollection_HAsciiString)& thePresentName,
Bnd_Box& theBox)
{
if (thePresentEntity.IsNull())
{
return Standard_False;
}
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
Handle(StepVisual_AnnotationOccurrence) anAO;
NCollection_Vector<Handle(StepVisual_StyledItem)> anAnnotations;
if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)))
{
anAO = Handle(StepVisual_AnnotationOccurrence)::DownCast(thePresentEntity);
if (!anAO.IsNull())
{
if (!anAO.IsNull()) {
thePresentName = anAO->Name();
anAnnotations.Append(anAO);
}
@@ -2099,17 +1973,17 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
}
if (!anAnnotations.Length())
{
return Standard_False;
}
BRep_Builder aB;
TopoDS_Compound aResAnnotation;
aB.MakeCompound(aResAnnotation);
Standard_Integer i = 0;
Bnd_Box aBox;
Standard_Integer aNbShapes = 0;
for (Standard_Integer i = 0; i < anAnnotations.Length(); i++)
Standard_Integer nbShapes = 0;
for (; i < anAnnotations.Length(); i++)
{
Handle(StepVisual_StyledItem) anItem = anAnnotations(i);
anAO = Handle(StepVisual_AnnotationOccurrence)::DownCast(anItem);
@@ -2120,19 +1994,19 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
anAnnotationShape = STEPConstruct::FindShape(aTP, aCurveItem);
if (anAnnotationShape.IsNull())
{
Handle(Transfer_Binder) aBinder = theTR->Actor()->Transfer(aCurveItem, aTP);
if (!aBinder.IsNull() && aBinder->HasResult()) {
anAnnotationShape = TransferBRep::ShapeResult(aTP, aBinder);
Handle(Transfer_Binder) binder = theTR->Actor()->Transfer(aCurveItem, aTP);
if (!binder.IsNull() && binder->HasResult()) {
anAnnotationShape = TransferBRep::ShapeResult(aTP, binder);
}
}
}
//case of tessellated entities
else
{
Handle(StepRepr_RepresentationItem) aRepresentationItem = anItem->Item();
if (aRepresentationItem.IsNull())
Handle(StepRepr_RepresentationItem) aTessItem = anItem->Item();
if (aTessItem.IsNull())
continue;
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aRepresentationItem);
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
if (aTessSet.IsNull())
continue;
gp_Trsf aTransf;
@@ -2140,7 +2014,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
{
Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location(), theLocalFactors);
Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
if (!aLocation.IsNull())
{
const gp_Ax3 anAx3Orig = gp::XOY();
@@ -2155,75 +2029,55 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
}
}
NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
Standard_Integer aNbItems = aListItems.IsNull() ? 0 : aListItems->Length();
Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
Handle(StepVisual_TessellatedCurveSet) aTessCurve;
for (Standard_Integer n = 1; n <= nb && aTessCurve.IsNull(); n++)
{
aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aListItems->Value(n));
}
if (aTessCurve.IsNull())
continue;
Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList();
if (aCoordList.IsNull())
continue;
Handle(TColgp_HArray1OfXYZ) aPoints = aCoordList->Points();
if (aPoints.IsNull() || aPoints->Length() == 0)
continue;
NCollection_Handle<StepVisual_VectorOfHSequenceOfInteger> aCurves = aTessCurve->Curves();
Standard_Integer aNbC = (aCurves.IsNull() ? 0 : aCurves->Length());
TopoDS_Compound aComp;
aB.MakeCompound(aComp);
for (Standard_Integer j = 1; j <= aNbItems; j++)
{
Handle(StepVisual_TessellatedItem) aTessItem = aListItems->Value(j);
if (aTessItem.IsNull())
{
continue;
}
if (aTessItem->IsKind(STANDARD_TYPE(StepVisual_TessellatedCurveSet)))
{
Handle(StepVisual_TessellatedCurveSet) aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aTessItem);
Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList();
if (aCoordList.IsNull())
{
continue;
}
Handle(TColgp_HArray1OfXYZ) aPoints = aCoordList->Points();
if (aPoints.IsNull() || aPoints->Length() == 0)
{
continue;
}
NCollection_Handle<StepVisual_VectorOfHSequenceOfInteger> aCurves = aTessCurve->Curves();
Standard_Integer aNbCurves = (aCurves.IsNull() ? 0 : aCurves->Length());
for (Standard_Integer k = 0; k < aNbCurves; k++)
{
Handle(TColStd_HSequenceOfInteger) anIndexes = aCurves->Value(k);
TopoDS_Wire aCurW;
aB.MakeWire(aCurW);
for (Standard_Integer n = 1; n < anIndexes->Length(); n++)
{
Standard_Integer anIndex = anIndexes->Value(n);
Standard_Integer aNextIndex = anIndexes->Value(n + 1);
if (anIndex > aPoints->Length() || aNextIndex > aPoints->Length())
{
continue;
}
gp_Pnt aP1(aPoints->Value(anIndex) * theFact);
gp_Pnt aP2(aPoints->Value(aNextIndex) * theFact);
BRepBuilderAPI_MakeEdge aMaker(aP1, aP2);
if (aMaker.IsDone())
{
TopoDS_Edge aCurE = aMaker.Edge();
aB.Add(aCurW, aCurE);
}
}
aB.Add(aComp, aCurW);
}
}
else if (aTessItem->IsKind(STANDARD_TYPE(StepVisual_ComplexTriangulatedSurfaceSet)))
{
Handle(StepVisual_ComplexTriangulatedSurfaceSet) aTessSurfSet = Handle(StepVisual_ComplexTriangulatedSurfaceSet)::DownCast(aTessItem);
Handle(Poly_Triangulation) aSurfSetMesh = createMesh(aTessSurfSet, theFact);
TopoDS_Face aFace;
aB.MakeFace(aFace, aSurfSetMesh);
aB.Add(aComp, aFace);
}
}
if (!aComp.IsNull())
Standard_Integer k = 0;
for (; k < aNbC; k++)
{
anAnnotationShape = aComp.Moved(aTransf);
Handle(TColStd_HSequenceOfInteger) anIndexes = aCurves->Value(k);
TopoDS_Wire aCurW;
aB.MakeWire(aCurW);
for (Standard_Integer n = 1; n < anIndexes->Length(); n++)
{
Standard_Integer ind = anIndexes->Value(n);
Standard_Integer indnext = anIndexes->Value(n + 1);
if (ind > aPoints->Length() || indnext > aPoints->Length())
continue;
gp_Pnt aP1(aPoints->Value(ind) * theFact);
gp_Pnt aP2(aPoints->Value(indnext) * theFact);
BRepBuilderAPI_MakeEdge aMaker(aP1, aP2);
if (aMaker.IsDone())
{
TopoDS_Edge aCurE = aMaker.Edge();
aB.Add(aCurW, aCurE);
}
}
aB.Add(aComp, aCurW);
}
anAnnotationShape = aComp.Moved(aTransf);
}
if (!anAnnotationShape.IsNull())
{
aNbShapes++;
nbShapes++;
aB.Add(aResAnnotation, anAnnotationShape);
if (i == anAnnotations.Length() - 1)
BRepBndLib::AddClose(anAnnotationShape, aBox);
@@ -2232,7 +2086,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
thePresentation = aResAnnotation;
theBox = aBox;
return (aNbShapes > 0);
return (nbShapes > 0);
}
//=======================================================================
@@ -2240,8 +2094,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
//purpose : read annotation plane
//=======================================================================
Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& theAnnotationPlane,
gp_Ax2& thePlane,
const StepData_Factors& theLocalFactors)
gp_Ax2& thePlane)
{
if (theAnnotationPlane.IsNull())
return Standard_False;
@@ -2261,7 +2114,7 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
if (aA2P3D.IsNull())
return Standard_False;
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aA2P3D, theLocalFactors);
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aA2P3D);
thePlane = anAxis->Ax2();
return Standard_True;
}
@@ -2273,8 +2126,7 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
//=======================================================================
void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
const Handle(Standard_Transient)& theGDT,
const Handle(Standard_Transient)& theDimObject,
const StepData_Factors& theLocalFactors)
const Handle(Standard_Transient)& theDimObject)
{
if (theGDT.IsNull() || theDimObject.IsNull())
return;
@@ -2303,9 +2155,8 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
Standard_Real aFact = aLocalFactors.LengthFactor();
anActor.PrepareUnits(aDModel, aTP);
Standard_Real aFact = StepData_GlobalFactors::Intance().LengthFactor();
// retrieve AnnotationPlane
Handle(StepRepr_RepresentationItem) aDMIAE = aDMIA->IdentifiedItemValue(1);
@@ -2317,7 +2168,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
for (subs.Start(); subs.More() && anAnPlane.IsNull(); subs.Next()) {
anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(subs.Value());
}
Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aPlaneAxes, aLocalFactors);
Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aPlaneAxes);
// set plane axes to XCAF
if (isHasPlane) {
@@ -2341,7 +2192,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
// Retrieve presentation
Bnd_Box aBox;
if (!readPMIPresentation(aDMIAE, theTR, aFact, aResAnnotation, aPresentName, aBox, aLocalFactors))
if (!readPMIPresentation(aDMIAE, theTR, aFact, aResAnnotation, aPresentName, aBox))
return;
gp_Pnt aPtext(0., 0., 0.);
// if Annotation plane location inside bounding box set it to text position
@@ -2389,8 +2240,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
//=======================================================================
void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
const Handle(Standard_Transient)& theGDT,
const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject,
const StepData_Factors& theLocalFactors)
const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject)
{
if (theGDT.IsNull() || theDimObject.IsNull())
return;
@@ -2412,9 +2262,8 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aSDR, aTP, aLocalFactors);
aFact = aLocalFactors.LengthFactor();
anActor.PrepareUnits(aSDR, aTP);
aFact = StepData_GlobalFactors::Intance().LengthFactor();
}
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
@@ -2669,8 +2518,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
const XCAFDimTolObjects_DatumModifWithValue theXCAFModifWithVal,
const Standard_Real theModifValue,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const Handle(XSControl_WorkSession)& theWS)
{
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -2691,7 +2539,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
collectShapeAspect(aSAR->RelatingShapeAspect(), theWS, aSAs);
Handle(StepDimTol_DatumFeature) aDF = Handle(StepDimTol_DatumFeature)::DownCast(aSAR->RelatingShapeAspect());
if (!aSAR->RelatingShapeAspect()->IsKind(STANDARD_TYPE(StepDimTol_DatumTarget)))
readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors);
readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj);
}
// Collect shape labels
@@ -2825,9 +2673,8 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
= Handle(StepGeom_Axis2Placement3d)::DownCast(aSRWP->ItemsValue(j));
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aSRWP, aTP, aLocalFactors);
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx, aLocalFactors);
anActor.PrepareUnits(aSRWP, aTP);
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx);
aDatTargetObj->SetDatumTargetAxis(anAxis->Ax2());
}
else if (aSRWP->ItemsValue(j)->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit)))
@@ -2842,7 +2689,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
if (aNU.IsNull())
continue;
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(aNU, theLocalFactors);
anUnitCtx.ComputeFactors(aNU);
aVal = aVal * anUnitCtx.LengthFactor();
if (aM->Name()->String().IsEqual("target length") ||
aM->Name()->String().IsEqual("target diameter"))
@@ -2872,7 +2719,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
aDatTargetObj->IsDatumTarget(Standard_True);
aDatTargetObj->SetDatumTargetNumber(aDT->TargetId()->IntegerValue());
readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors);
readAnnotation(aTR, aDT, aDatTargetObj);
aDat->SetObject(aDatTargetObj);
isExistDatumTarget = Standard_True;
}
@@ -2901,7 +2748,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
if (aDatObj->GetPresentation().IsNull()) {
// Try find annotation connected to datum entity (not right case, according recommended practices)
readAnnotation(aTR, theDat, aDatObj, theLocalFactors);
readAnnotation(aTR, theDat, aDatObj);
}
aDat->SetObject(aDatObj);
}
@@ -2917,8 +2764,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
Standard_Boolean STEPCAFControl_Reader::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 Handle(XSControl_WorkSession)& theWS)
{
const Handle(XSControl_TransferReader) &aTR = theWS->TransferReader();
const Handle(Transfer_TransientProcess) &aTP = aTR->TransientProcess();
@@ -2999,7 +2845,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
aModifValue = aVal * anUnitCtx.LengthFactor();
}
}
@@ -3011,7 +2857,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
if (anIterDRC.Value()->IsKind(STANDARD_TYPE(StepDimTol_Datum)))
{
Handle(StepDimTol_Datum) aD = Handle(StepDimTol_Datum)::DownCast(anIterDRC.Value());
setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS, theLocalFactors);
setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS);
}
else if (anIterDRC.Value()->IsKind(STANDARD_TYPE(StepDimTol_DatumReferenceElement)))
{
@@ -3036,7 +2882,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
aModifValue = aVal * anUnitCtx.LengthFactor();
}
}
@@ -3046,7 +2892,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
if (anIterDRE.Value()->IsKind(STANDARD_TYPE(StepDimTol_Datum)))
{
Handle(StepDimTol_Datum) aD = Handle(StepDimTol_Datum)::DownCast(anIterDRE.Value());
setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS, theLocalFactors);
setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS);
}
}
}
@@ -3065,8 +2911,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
//=======================================================================
TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const Handle(XSControl_WorkSession)& theWS)
{
TDF_Label aGDTL;
if (!theEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)) &&
@@ -3237,7 +3082,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
dim1 = dim1 * anUnitCtx.LengthFactor();
}
}
@@ -3253,7 +3098,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
dim2 = dim2 * anUnitCtx.LengthFactor();
}
}
@@ -3294,7 +3139,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
dim = dim * anUnitCtx.LengthFactor();
//std::cout<<"GeometricTolerance: Magnitude = "<<dim<<std::endl;
Handle(TColStd_HArray1OfReal) arr = new TColStd_HArray1OfReal(1, 1);
@@ -3514,7 +3359,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
TDataStd_Name::Set(aGDTL, str);
}
readDatumsAP242(theEnt, aGDTL, theDoc, theWS, theLocalFactors);
readDatumsAP242(theEnt, aGDTL, theDoc, theWS);
}
return aGDTL;
}
@@ -3545,8 +3390,7 @@ void convertAngleValue(
static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
const TDF_Label& aDimL,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const Handle(XSControl_WorkSession)& theWS)
{
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -3611,7 +3455,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
aVal = aVal * anUnitCtx.LengthFactor();
@@ -3638,7 +3482,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI))) {
aVal = aVal * anUnitCtx.LengthFactor();
}
@@ -3718,7 +3562,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtxUpperBound;
anUnitCtxUpperBound.ComputeFactors(NU, theLocalFactors);
anUnitCtxUpperBound.ComputeFactors(NU);
if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
{
@@ -3754,7 +3598,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtxLowerBound;
anUnitCtxLowerBound.ComputeFactors(NU, theLocalFactors);
anUnitCtxLowerBound.ComputeFactors(NU);
if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
{
@@ -3940,15 +3784,14 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
//for Oriented Dimensional Location
Handle(TColStd_HArray1OfReal) aDirArr = anAP->RefDirection()->DirectionRatios();
gp_Dir aDir;
Standard_Integer aDirLower = aDirArr->Lower();
if (!aDirArr.IsNull() && aDirArr->Length() > 2)
{
aDir.SetCoord(aDirArr->Value(aDirLower), aDirArr->Value(aDirLower + 1), aDirArr->Value(aDirLower + 2));
aDir.SetCoord(aDirArr->Lower(), aDirArr->Lower() + 1, aDirArr->Lower() + 2);
aDimObj->SetDirection(aDir);
}
else if (aDirArr->Length() > 1)
{
aDir.SetCoord(aDirArr->Value(aDirLower), aDirArr->Value(aDirLower + 1), 0);
aDir.SetCoord(aDirArr->Lower(), aDirArr->Lower() + 1, 0);
aDimObj->SetDirection(aDir);
}
}
@@ -3965,8 +3808,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (aDimL.FindAttribute(XCAFDoc_Dimension::GetID(), aDim))
{
readAnnotation(aTR, theEnt, aDimObj, theLocalFactors);
readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors);
readAnnotation(aTR, theEnt, aDimObj);
readConnectionPoints(aTR, theEnt, aDimObj);
aDim->SetObject(aDimObj);
}
}
@@ -4087,8 +3930,7 @@ static Standard_Boolean getTolType(const Handle(Standard_Transient)& theEnt,
static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
const TDF_Label& theTolL,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const Handle(XSControl_WorkSession)& theWS)
{
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -4114,7 +3956,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) return;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
aVal = aVal * anUnitCtx.LengthFactor();
aTolObj->SetValue(aVal);
}
@@ -4139,7 +3981,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) return;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
aVal = aVal * anUnitCtx.LengthFactor();
aTolObj->SetValueOfZoneModifier(aVal);
aTolObj->SetZoneModifier(XCAFDimTolObjects_GeomToleranceZoneModif_Projected);
@@ -4157,7 +3999,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
convertAngleValue(anUnitCtx, aVal);
aTolObj->SetValueOfZoneModifier(aVal);
aTolObj->SetZoneModifier(XCAFDimTolObjects_GeomToleranceZoneModif_Runout);
@@ -4230,12 +4072,12 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
{
Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
convertAngleValue(anUnitCtx, aVal);
aTolObj->SetMaxValueModifier(aVal);
}
readAnnotation(aTR, theEnt, aTolObj, theLocalFactors);
readAnnotation(aTR, theEnt, aTolObj);
aGTol->SetObject(aTolObj);
}
@@ -4245,8 +4087,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
//=======================================================================
Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSession)& theWS,
const Handle(TDocStd_Document)& theDoc,
const StepData_Factors& theLocalFactors)
const Handle(TDocStd_Document)& theDoc)
{
const Handle(Interface_InterfaceModel) &aModel = theWS->Model();
const Interface_Graph& aGraph = theWS->Graph();
@@ -4266,13 +4107,13 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
if (anEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)) ||
anEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation)) ||
anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS, theLocalFactors);
TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS);
if (!aGDTL.IsNull()) {
if (anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS);
}
else {
setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS);
}
}
}
@@ -4359,21 +4200,20 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
// Calculate unit
Standard_Real aFact = 1.0;
StepData_Factors aLocalFactors = theLocalFactors;
if (!aDMIA.IsNull())
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
Handle(Transfer_TransientProcess) aTP = aTR->TransientProcess();
anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP, aLocalFactors);
aFact = aLocalFactors.LengthFactor();
anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP);
aFact = StepData_GlobalFactors::Intance().LengthFactor();
}
// Presentation
TopoDS_Shape aPresentation;
Handle(TCollection_HAsciiString) aPresentName;
Bnd_Box aBox;
if (!readPMIPresentation(anEnt, aTR, aFact, aPresentation, aPresentName, aBox, aLocalFactors))
if (!readPMIPresentation(anEnt, aTR, aFact, aPresentation, aPresentName, aBox))
continue;
// Annotation plane
Handle(StepVisual_AnnotationPlane) anAnPlane;
@@ -4400,7 +4240,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
aDGTTool->SetDimension(aShapesL, anEmptySeq2, aGDTL);
gp_Ax2 aPlaneAxes;
if (!anAnPlane.IsNull()) {
if (readAnnotationPlane(anAnPlane, aPlaneAxes, aLocalFactors))
if (readAnnotationPlane(anAnPlane, aPlaneAxes))
aDimObj->SetPlane(aPlaneAxes);
}
aDimObj->SetPresentation(aPresentation, aPresentName);
@@ -4458,8 +4298,7 @@ static Handle(StepShape_SolidModel) FindSolidForPDS(const Handle(StepRepr_Produc
Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_WorkSession) &WS,
const Handle(TDocStd_Document)& Doc,
const Handle(TColStd_HSequenceOfTransient)& SeqPDS,
const StepData_Factors& theLocalFactors) const
const Handle(TColStd_HSequenceOfTransient)& SeqPDS) const
{
const Handle(XSControl_TransferReader) &TR = WS->TransferReader();
const Handle(Transfer_TransientProcess) &TP = TR->TransientProcess();
@@ -4527,11 +4366,11 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor
NU->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit)))
{
STEPConstruct_UnitContext anUnitCtx;
anUnitCtx.ComputeFactors(NU, theLocalFactors);
anUnitCtx.ComputeFactors(NU);
aDensity = aDensity / (anUnitCtx.LengthFactor()*anUnitCtx.LengthFactor()*anUnitCtx.LengthFactor());
// transfer length value for Density from millimeter to santimeter
// in order to result density has dimension gram/(sm*sm*sm)
const Standard_Real aCascadeUnit = theLocalFactors.CascadeUnit();
const Standard_Real aCascadeUnit = StepData_GlobalFactors::Intance().CascadeUnit();
aDensity = aDensity*1000. / (aCascadeUnit * aCascadeUnit * aCascadeUnit);
}
if (NU->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit))) {
@@ -4612,8 +4451,7 @@ void collectViewShapes(const Handle(XSControl_WorkSession)& theWS,
//=======================================================================
Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_GeometricRepresentationItem)& theClippingCameraModel,
TDF_LabelSequence& theClippingPlanes,
const Handle(XCAFDoc_ClippingPlaneTool)& theTool,
const StepData_Factors& theLocalFactors)
const Handle(XCAFDoc_ClippingPlaneTool)& theTool)
{
Handle(TCollection_HAsciiString) anExpression = new TCollection_HAsciiString();
NCollection_Sequence<Handle(StepGeom_GeometricRepresentationItem)> aPlanes;
@@ -4632,7 +4470,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
Handle(StepVisual_CameraModelD3MultiClippingUnion) aCameraModelUnion =
aCameraModel->ShapeClipping()->Value(1).CameraModelD3MultiClippingUnion();
if (!aCameraModelUnion.IsNull())
return buildClippingPlanes(aCameraModelUnion, theClippingPlanes, theTool, theLocalFactors);
return buildClippingPlanes(aCameraModelUnion, theClippingPlanes, theTool);
}
for (Standard_Integer i = 1; i <= aCameraModel->ShapeClipping()->Length(); i++) {
aPlanes.Append(Handle(StepGeom_GeometricRepresentationItem)::DownCast(aCameraModel->ShapeClipping()->Value(i).Value()));
@@ -4658,7 +4496,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
for (Standard_Integer i = 1; i <= aPlanes.Length(); i++) {
Handle(StepGeom_Plane) aPlaneEnt = Handle(StepGeom_Plane)::DownCast(aPlanes.Value(i));
if (!aPlaneEnt.IsNull()) {
Handle(Geom_Plane) aPlane = StepToGeom::MakePlane(aPlaneEnt, theLocalFactors);
Handle(Geom_Plane) aPlane = StepToGeom::MakePlane(aPlaneEnt);
if (!aPlane.IsNull()) {
TDF_Label aPlaneL = theTool->AddClippingPlane(aPlane->Pln(), aPlaneEnt->Name());
theClippingPlanes.Append(aPlaneL);
@@ -4668,7 +4506,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
}
}
else {
anExpression->AssignCat(buildClippingPlanes(aPlanes.Value(i), theClippingPlanes, theTool, theLocalFactors));
anExpression->AssignCat(buildClippingPlanes(aPlanes.Value(i), theClippingPlanes, theTool));
}
anExpression->AssignCat(anOperation);
}
@@ -4682,9 +4520,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
//function : ReadViews
//purpose :
//=======================================================================
Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSession)& theWS,
const Handle(TDocStd_Document)& theDoc,
const StepData_Factors& theLocalFactors) const
Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSession)& theWS, const Handle(TDocStd_Document)& theDoc) const
{
const Handle(Interface_InterfaceModel) &aModel = theWS->Model();
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
@@ -4715,16 +4551,15 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
}
aDModel = Handle(StepVisual_DraughtingModel)::DownCast(subs.Value());
}
StepData_Factors aLocalFactors = theLocalFactors;
if (!aDModel.IsNull())
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
anActor.PrepareUnits(aDModel, aTP);
}
anObj->SetName(aCameraModel->Name());
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aCameraModel->ViewReferenceSystem(), aLocalFactors);
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aCameraModel->ViewReferenceSystem());
anObj->SetViewDirection(anAxis->Direction());
anObj->SetUpDirection(anAxis->Direction() ^ anAxis->XDirection());
Handle(StepVisual_ViewVolume) aViewVolume = aCameraModel->PerspectiveOfVolume();
@@ -4734,7 +4569,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
else if (aViewVolume->ProjectionType() == StepVisual_copParallel)
aType = XCAFView_ProjectionType_Parallel;
anObj->SetType(aType);
Handle(Geom_CartesianPoint) aPoint = StepToGeom::MakeCartesianPoint(aViewVolume->ProjectionPoint(), aLocalFactors);
Handle(Geom_CartesianPoint) aPoint = StepToGeom::MakeCartesianPoint(aViewVolume->ProjectionPoint());
anObj->SetProjectionPoint(aPoint->Pnt());
anObj->SetZoomFactor(aViewVolume->ViewPlaneDistance());
anObj->SetWindowHorizontalSize(aViewVolume->ViewWindow()->SizeInX());
@@ -4751,7 +4586,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
if (!aClippingCameraModel.IsNull()) {
Handle(TCollection_HAsciiString) aClippingExpression;
Handle(XCAFDoc_ClippingPlaneTool) aClippingPlaneTool = XCAFDoc_DocumentTool::ClippingPlaneTool(theDoc->Main());
aClippingExpression = buildClippingPlanes(aClippingCameraModel, aClippingPlanes, aClippingPlaneTool, aLocalFactors);
aClippingExpression = buildClippingPlanes(aClippingCameraModel, aClippingPlanes, aClippingPlaneTool);
anObj->SetClippingExpression(aClippingExpression);
}

View File

@@ -38,7 +38,6 @@ class StepShape_ConnectedFaceSet;
class StepRepr_NextAssemblyUsageOccurrence;
class STEPConstruct_Tool;
class StepDimTol_Datum;
class StepData_Factors;
//! Provides a tool to read STEP file and put it into
@@ -213,8 +212,7 @@ protected:
//! corresponding color assignments in the DECAF document
Standard_EXPORT Standard_Boolean ReadColors
(const Handle(XSControl_WorkSession)& WS,
const Handle(TDocStd_Document)& doc,
const StepData_Factors& theLocalFactors) const;
const Handle(TDocStd_Document)& doc) const;
//! Reads names of parts defined in the STEP model and
//! assigns them to corresponding labels in the DECAF document
@@ -223,10 +221,7 @@ protected:
//! Reads validation properties assigned to shapes in the STEP
//! model and assigns them to corresponding labels in the DECAF
//! document
Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS,
const Handle(TDocStd_Document)& doc,
const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
const StepData_Factors& theLocalFactors) const;
Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const;
//! Reads layers of parts defined in the STEP model and
//! set reference between shape and layers in the DECAF document
@@ -238,21 +233,14 @@ protected:
//! Reads D&GT for instances defined in the STEP model and
//! 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);
Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc);
//! 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;
Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const Handle(TColStd_HSequenceOfTransient)& SeqPDS) 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;
Standard_EXPORT Standard_Boolean ReadViews(const Handle(XSControl_WorkSession)& theWS, const Handle(TDocStd_Document)& theDoc) const;
//! Populates the sub-Label of the passed TDF Label with shape
//! data associated with the given STEP Representation Item,
@@ -293,26 +281,22 @@ private:
const XCAFDimTolObjects_DatumModifWithValue theXCAFModifWithVal,
const Standard_Real theModifValue,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors);
const Handle(XSControl_WorkSession)& theWS);
//! 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 Handle(XSControl_WorkSession)& theWS);
//! 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 Handle(XSControl_WorkSession)& theWS);
//! Prepares units for transfer
void prepareUnits(const Handle(StepData_StepModel)& theModel,
const Handle(TDocStd_Document)& theDoc,
StepData_Factors& theLocalFactors) const;
const Handle(TDocStd_Document)& theDoc) const;
private:

View File

@@ -56,7 +56,6 @@
#include <STEPConstruct_Styles.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <STEPControl_StepModelType.hxx>
#include <StepData_Factors.hxx>
#include <StepData_Logical.hxx>
#include <StepData_StepModel.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
@@ -349,21 +348,18 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write(const Standard_CString theFil
//purpose :
//=======================================================================
void STEPCAFControl_Writer::prepareUnit(const TDF_Label& theLabel,
const Handle(StepData_StepModel)& theModel,
StepData_Factors& theLocalFactors)
const Handle(StepData_StepModel)& theModel)
{
Handle(XCAFDoc_LengthUnit) aLengthAttr;
if (!theLabel.IsNull() &&
theLabel.Root().FindAttribute(XCAFDoc_LengthUnit::GetID(), aLengthAttr))
{
theModel->SetLocalLengthUnit(aLengthAttr->GetUnitValue() * 1000); // convert to mm
theLocalFactors.SetCascadeUnit(aLengthAttr->GetUnitValue() * 1000);
}
else
{
XSAlgo::AlgoContainer()->PrepareForTransfer(); // update unit info
theModel->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
theLocalFactors.SetCascadeUnit(UnitsMethods::GetCasCadeLengthUnit());
}
}
@@ -515,9 +511,8 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
Handle(STEPCAFControl_ActorWrite) anActor =
Handle(STEPCAFControl_ActorWrite)::DownCast(theWriter.WS()->NormAdaptor()->ActorWrite());
StepData_Factors aLocalFactors;
const Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(theWriter.WS()->Model());
prepareUnit(theLabels.First(), aModel, aLocalFactors); // set local length unit to the model
prepareUnit(theLabels.First(), aModel); // set local length unit to the model
// translate free top-level shapes of the DECAF document
const Standard_Integer aStepSchema = Interface_Static::IVal("write.step.schema");
TDF_LabelSequence aSubLabels;
@@ -619,7 +614,7 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
{
// translate final solids
Message_ProgressScope aPS1(aRange, NULL, 2);
TopoDS_Shape aSass = transferExternFiles(aCurL, theMode, aSubLabels, aLocalFactors, theIsMulti, aPS1.Next());
TopoDS_Shape aSass = transferExternFiles(aCurL, theMode, aSubLabels, theIsMulti, aPS1.Next());
if (aPS1.UserBreak())
return Standard_False;
@@ -658,7 +653,7 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
{
if (aStepSchema == 5)
{
writeDGTsAP242(theWriter.WS(), aSubLabels, aLocalFactors);
writeDGTsAP242(theWriter.WS(), aSubLabels);
}
else
{
@@ -738,7 +733,6 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
TopoDS_Shape STEPCAFControl_Writer::transferExternFiles(const TDF_Label& theLabel,
const STEPControl_StepModelType theMode,
TDF_LabelSequence& theLabels,
const StepData_Factors& theLocalFactors,
const Standard_CString thePrefix,
const Message_ProgressRange& theProgress)
{
@@ -821,7 +815,7 @@ TopoDS_Shape STEPCAFControl_Writer::transferExternFiles(const TDF_Label& theLabe
TDF_Label aRefL;
if (!XCAFDoc_ShapeTool::GetReferredShape(aCurL, aRefL))
continue;
TopoDS_Shape aShComp = transferExternFiles(aRefL, theMode, theLabels, theLocalFactors, thePrefix, aPS.Next());
TopoDS_Shape aShComp = transferExternFiles(aRefL, theMode, theLabels, thePrefix, aPS.Next());
aShComp.Location(XCAFDoc_ShapeTool::GetLocation(aCurL));
aBuilder.Add(aComp, aShComp);
}
@@ -2463,8 +2457,7 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession
const Standard_Boolean theHasPlane,
const gp_Ax2& theAnnotationPlane,
const gp_Pnt& theTextPosition,
const Handle(Standard_Transient)& theDimension,
const StepData_Factors& theLocalFactors)
const Handle(Standard_Transient)& theDimension)
{
if (thePresentation.IsNull())
return;
@@ -2473,10 +2466,6 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession
// Presentation
Handle(StepVisual_TessellatedGeometricSet) aGeomSet = STEPCAFControl_GDTProperty::GetTessellation(thePresentation);
if (aGeomSet.IsNull())
{
return;
}
Handle(StepVisual_TessellatedAnnotationOccurrence) aTAO = new StepVisual_TessellatedAnnotationOccurrence();
aTAO->Init(new TCollection_HAsciiString(), myGDTPrsCurveStyle, aGeomSet);
StepVisual_DraughtingCalloutElement aDCElement;
@@ -2519,7 +2508,7 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession
aPrsStyles->SetValue(1, aPrsStyle);
// Plane
Handle(StepGeom_Plane) aPlane = new StepGeom_Plane();
GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane, theLocalFactors);
GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane);
const Handle(StepGeom_Axis2Placement3d)& anAxis = anAxisMaker.Value();
// Set text position to plane origin
Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint();
@@ -2551,8 +2540,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
const TDF_LabelSequence& theShapeL,
const TDF_Label& theDatumL,
const Standard_Boolean theIsFirstDTarget,
const Handle(StepDimTol_Datum)& theWrittenDatum,
const StepData_Factors& theLocalFactors)
const Handle(StepDimTol_Datum)& theWrittenDatum)
{
// Get working data
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -2706,7 +2694,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
// Common for all datum targets
StepBasic_Unit aUnit = GetUnit(aRC);
gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis();
GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis, theLocalFactors);
GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis);
Handle(StepGeom_Axis2Placement3d) anA2P3D = anAxisMaker.Value();
anA2P3D->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepRepr_HArray1OfRepresentationItem) anItems;
@@ -2800,7 +2788,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
//Annotation plane and Presentation
writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
anObject->GetPlane(), anObject->GetPointTextAttach(), aSA, theLocalFactors);
anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
return aDatum;
}
@@ -2813,8 +2801,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS,
const Handle(XCAFDimTolObjects_DimensionObject)& theObject,
const Handle(StepRepr_RepresentationContext)& theRC,
const StepShape_DimensionalCharacteristic& theDimension,
const StepData_Factors& theLocalFactors)
const StepShape_DimensionalCharacteristic& theDimension)
{
// Get working data
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -2941,7 +2928,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS,
Handle(StepGeom_Axis2Placement3d) anOrientation = new StepGeom_Axis2Placement3d();
gp_Dir aDir;
theObject->GetDirection(aDir);
GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0));
const Handle(StepGeom_CartesianPoint)& aLoc = MkPoint.Value();
Handle(StepGeom_Direction) anAxis = new StepGeom_Direction();
Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3);
@@ -3038,14 +3025,13 @@ static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS,
const Handle(StepRepr_ConstructiveGeometryRepresentation)& theRepr,
Handle(StepRepr_ShapeAspect)& theFirstSA,
Handle(StepRepr_ShapeAspect)& theSecondSA,
NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts,
const StepData_Factors& theLocalFactors)
NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
{
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
// First point
if (theObject->HasPoint())
{
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint(), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint());
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
thePnts.Append(aPoint);
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
@@ -3066,7 +3052,7 @@ static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS,
// Second point (for locations)
if (theObject->HasPoint2())
{
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2(), theLocalFactors.LengthFactor());
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
thePnts.Append(aPoint);
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
@@ -3094,8 +3080,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
const TDF_Label theGeomTolL,
const TDF_LabelSequence& theDatumSeq,
const STEPConstruct_DataMapOfAsciiStringTransient& theDatumMap,
const Handle(StepRepr_RepresentationContext)& theRC,
const StepData_Factors& theLocalFactors)
const Handle(StepRepr_RepresentationContext)& theRC)
{
// Get working data
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -3264,7 +3249,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
// Axis
if (anObject->HasAxis())
{
GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis(), theLocalFactors);
GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis());
Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value();
anAxis->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
@@ -3350,8 +3335,7 @@ void STEPCAFControl_Writer::writeGeomTolerance(const Handle(XSControl_WorkSessio
const TDF_LabelSequence& theShapeSeqL,
const TDF_Label& theGeomTolL,
const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
const Handle(StepRepr_RepresentationContext)& theRC,
const StepData_Factors& theLocalFactors)
const Handle(StepRepr_RepresentationContext)& theRC)
{
// Get working data
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -3548,7 +3532,7 @@ void STEPCAFControl_Writer::writeGeomTolerance(const Handle(XSControl_WorkSessio
writeToleranceZone(theWS, anObject, aGeomTol, theRC);
//Annotation plane and Presentation
writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol, theLocalFactors);
anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol);
}
//=======================================================================
@@ -3930,8 +3914,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTs(const Handle(XSControl_WorkSes
//purpose :
//=======================================================================
Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_WorkSession)& theWS,
const TDF_LabelSequence& theLabels,
const StepData_Factors& theLocalFactors)
const TDF_LabelSequence& theLabels)
{
(void)theLabels;
// Get working data
@@ -3987,8 +3970,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
Handle(Standard_Transient) aWrittenDatum;
Standard_Boolean isFirstDT = !aDatumMap.Find(aDatumName, aWrittenDatum);
Handle(StepDimTol_Datum) aDatum = writeDatumAP242(theWS, aShapeL, aDatumL, isFirstDT,
Handle(StepDimTol_Datum)::DownCast(aWrittenDatum),
theLocalFactors);
Handle(StepDimTol_Datum)::DownCast(aWrittenDatum));
// Add created Datum into Map
aDatumMap.Bind(aDatumName, aDatum);
}
@@ -4030,7 +4012,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
aSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), myGDTCommonPDS, StepData_LTrue);
aModel->AddWithRefs(aSA);
writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->HasPlane(),
Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aSA, theLocalFactors);
Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
}
if (!XCAFDoc_DimTolTool::GetRefShapeLabel(aDimensionL, aFirstShapeL, aSecondShapeL))
@@ -4102,14 +4084,14 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
if (anObject->GetType() == XCAFDimTolObjects_DimensionType_DimensionPresentation)
{
writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->HasPlane(),
Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aFirstSA, theLocalFactors);
Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aFirstSA);
continue;
}
// Write dimensions
StepShape_DimensionalCharacteristic aDimension;
if (anObject->HasPoint() || anObject->HasPoint2())
WriteDerivedGeometry(theWS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts, theLocalFactors);
WriteDerivedGeometry(theWS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts);
XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType))
{
@@ -4183,10 +4165,10 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
}
// Write values
WriteDimValues(theWS, anObject, aRC, aDimension, theLocalFactors);
WriteDimValues(theWS, anObject, aRC, aDimension);
//Annotation plane and Presentation
writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value(), theLocalFactors);
anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
}
// Write Derived geometry
if (aConnectionPnts.Length() > 0)
@@ -4221,8 +4203,8 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
XCAFDoc_DimTolTool::GetDatumWithObjectOfTolerLabels(aGeomTolL, aDatumSeq);
Handle(StepDimTol_HArray1OfDatumSystemOrReference) aDatumSystem;
if (aDatumSeq.Length() > 0)
aDatumSystem = WriteDatumSystem(theWS, aGeomTolL, aDatumSeq, aDatumMap, aRC, theLocalFactors);
writeGeomTolerance(theWS, aFirstShapeL, aGeomTolL, aDatumSystem, aRC, theLocalFactors);
aDatumSystem = WriteDatumSystem(theWS, aGeomTolL, aDatumSeq, aDatumMap, aRC);
writeGeomTolerance(theWS, aFirstShapeL, aGeomTolL, aDatumSystem, aRC);
}
// Write Draughting model for Annotation Planes

View File

@@ -38,7 +38,6 @@ class XSControl_WorkSession;
class TDocStd_Document;
class STEPCAFControl_ExternFile;
class TopoDS_Shape;
class StepData_Factors;
//! Provides a tool to write DECAF document to the
//! STEP file. Besides transfer of shapes (including
@@ -189,7 +188,6 @@ protected:
TopoDS_Shape transferExternFiles(const TDF_Label& theLabel,
const STEPControl_StepModelType theMode,
TDF_LabelSequence& theLabelSeq,
const StepData_Factors& theLocalFactors,
const Standard_CString thePrefix = "",
const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -211,8 +209,7 @@ protected:
//! Write D&GTs assigned to specified labels, to STEP model, according AP242
Standard_Boolean writeDGTsAP242(const Handle(XSControl_WorkSession)& theWS,
const TDF_LabelSequence& theLabels,
const StepData_Factors& theLocalFactors);
const TDF_LabelSequence& theLabels);
//! Write materials assigned to specified labels, to STEP model
Standard_Boolean writeMaterials(const Handle(XSControl_WorkSession)& theWS,
@@ -236,8 +233,7 @@ protected:
//! If it exists, initializes local length unit from it
//! Else initializes according to Cascade length unit
void prepareUnit(const TDF_Label& theLabel,
const Handle(StepData_StepModel)& theModel,
StepData_Factors& theLocalFactors);
const Handle(StepData_StepModel)& theModel);
Handle(StepRepr_ShapeAspect) writeShapeAspect(const Handle(XSControl_WorkSession)& theWS,
const TDF_Label theLabel,
@@ -252,15 +248,13 @@ protected:
const Standard_Boolean theHasPlane,
const gp_Ax2& theAnnotationPlane,
const gp_Pnt& theTextPosition,
const Handle(Standard_Transient)& theDimension,
const StepData_Factors& theLocalFactors);
const Handle(Standard_Transient)& theDimension);
Handle(StepDimTol_Datum) writeDatumAP242(const Handle(XSControl_WorkSession)& theWS,
const TDF_LabelSequence& theShapeL,
const TDF_Label& theDatumL,
const Standard_Boolean isFirstDTarget,
const Handle(StepDimTol_Datum)& theWrittenDatum,
const StepData_Factors& theLocalFactors);
const Handle(StepDimTol_Datum)& theWrittenDatum);
void writeToleranceZone(const Handle(XSControl_WorkSession)& theWS,
const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
@@ -271,8 +265,7 @@ protected:
const TDF_LabelSequence& theShapeSeqL,
const TDF_Label& theGeomTolL,
const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
const Handle(StepRepr_RepresentationContext)& theRC,
const StepData_Factors& theLocalFactors);
const Handle(StepRepr_RepresentationContext)& theRC);
private:

View File

@@ -82,15 +82,6 @@ void STEPConstruct_ContextTool::SetModel (const Handle(StepData_StepModel)& aSte
}
}
//=======================================================================
//function : SetGlobalFactor
//purpose :
//=======================================================================
void STEPConstruct_ContextTool::SetGlobalFactor(const StepData_Factors& theGlobalFactor)
{
myGlobalFactor = theGlobalFactor;
}
//=======================================================================
//function : GetAPD
//purpose :
@@ -454,7 +445,7 @@ void STEPConstruct_ContextTool::SetSDR (const Handle(StepShape_ShapeDefinitionRe
Handle(StepGeom_Axis2Placement3d) STEPConstruct_ContextTool::GetDefaultAxis ()
{
if ( myAxis.IsNull() ) {
GeomToStep_MakeAxis2Placement3d mkax(myGlobalFactor);
GeomToStep_MakeAxis2Placement3d mkax;
myAxis = mkax.Value();
}
return myAxis;

View File

@@ -23,7 +23,6 @@
#include <TColStd_SequenceOfInteger.hxx>
#include <STEPConstruct_AP203Context.hxx>
#include <StepData_Factors.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
class StepBasic_ApplicationProtocolDefinition;
@@ -55,8 +54,6 @@ public:
//! Initialize ApplicationProtocolDefinition by the first
//! entity of that type found in the model
Standard_EXPORT void SetModel (const Handle(StepData_StepModel)& aStepModel);
Standard_EXPORT void SetGlobalFactor(const StepData_Factors& theGlobalFactor);
Standard_EXPORT Handle(StepBasic_ApplicationProtocolDefinition) GetAPD();
@@ -142,7 +139,7 @@ private:
Handle(StepBasic_ApplicationProtocolDefinition) theAPD;
STEPConstruct_AP203Context theAP203;
Handle(StepGeom_Axis2Placement3d) myAxis;
StepData_Factors myGlobalFactor;
};

View File

@@ -33,8 +33,8 @@
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
#include <StepBasic_SiUnitAndVolumeUnit.hxx>
#include <StepData_GlobalFactors.hxx>
#include <STEPConstruct_UnitContext.hxx>
#include <StepData_Factors.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
#include <StepRepr_GlobalUnitAssignedContext.hxx>
@@ -63,8 +63,7 @@ STEPConstruct_UnitContext::STEPConstruct_UnitContext()
//purpose :
//=======================================================================
void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d,
const StepData_Factors& theLocalFactors)
void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d)
{
done = Standard_True;
@@ -156,7 +155,7 @@ void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d,
Handle(StepBasic_MeasureValueMember) mvs = new StepBasic_MeasureValueMember;
mvs->SetName("LENGTH_MEASURE");
mvs->SetReal ( Tol3d / theLocalFactors.LengthFactor() );
mvs->SetReal ( Tol3d / StepData_GlobalFactors::Intance().LengthFactor() );
StepBasic_Unit Unit;
Unit.SetValue ( lengthUnit );
theTol3d->Init(mvs, Unit, TolName, TolDesc);
@@ -243,8 +242,7 @@ Standard_Boolean STEPConstruct_UnitContext::SiUnitNameFactor(const Handle(StepBa
// Purpose :
// ==========================================================================
Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr_GlobalUnitAssignedContext)& aContext,
const StepData_Factors& theLocalFactors)
Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr_GlobalUnitAssignedContext)& aContext)
{
Standard_Integer status = 0;
@@ -270,7 +268,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
for (Standard_Integer i = 1; i <= nbU; i++) {
Handle(StepBasic_NamedUnit) theNamedUnit = aContext->UnitsValue(i);
status = ComputeFactors(theNamedUnit, theLocalFactors);
status = ComputeFactors(theNamedUnit);
#ifdef OCCT_DEBUG
if(status == -1)
std::cout << " -- STEPConstruct_UnitContext:ComputeFactor: Unit item no." << i << " is not recognized" << std::endl;
@@ -280,8 +278,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
}
Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasic_NamedUnit)& aUnit,
const StepData_Factors& theLocalFactors)
Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasic_NamedUnit)& aUnit)
{
//:f3 abv 8 Apr 98: ProSTEP TR8 tr8_as_sd_sw: the case of unrecognized entity
@@ -382,7 +379,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
return 0;
}
const Standard_Real aCascadeUnit = theLocalFactors.CascadeUnit();
const Standard_Real aCascadeUnit = StepData_GlobalFactors::Intance().CascadeUnit();
if (aUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndLengthUnit))||
aUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
#ifdef METER

Some files were not shown because too many files have changed in this diff Show More