mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-25 08:50:36 +05:00
Porting Salome to OCCT 7.7.0
This commit is contained in:
parent
63e04ef7a7
commit
922cc08eea
@ -90,13 +90,12 @@ void VolumeSection::CenterOfGravity()
|
||||
if(Tr.IsNull())
|
||||
MESSAGE("Error, null layer" );
|
||||
nbNodes = Tr->NbNodes();
|
||||
const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
|
||||
|
||||
// Calcul des dimensions de la boite englobante du solide
|
||||
|
||||
for(i=1;i<=nbNodes;i++)
|
||||
{
|
||||
InitPoint = Nodes(i).Transformed(L.Transformation());
|
||||
InitPoint = Tr->Node(i).Transformed(L.Transformation());
|
||||
if(InitPoint.X() < Xmin)
|
||||
Xmin = InitPoint.X();
|
||||
if(InitPoint.X() > Xmax)
|
||||
@ -142,10 +141,7 @@ Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
|
||||
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
|
||||
if(Tr.IsNull())
|
||||
MESSAGE("Error, null layer" );
|
||||
const Poly_Array1OfTriangle& triangles = Tr->Triangles();
|
||||
Standard_Integer nbTriangles = Tr->NbTriangles();
|
||||
//nbNodes = Tr->NbNodes();
|
||||
const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
|
||||
|
||||
// Calcul des volumes de chaque triangle, de chaque face
|
||||
// en tenant compte des triangles coupes par le plan de section
|
||||
@ -155,15 +151,15 @@ Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
|
||||
Determinant=0;
|
||||
//Gardons la meme orientation des noeuds
|
||||
if (F.Orientation() == TopAbs_REVERSED)
|
||||
triangles(i).Get(noeud[0], noeud[2], noeud[1]);
|
||||
Tr->Triangle(i).Get(noeud[0], noeud[2], noeud[1]);
|
||||
else
|
||||
triangles(i).Get(noeud[0], noeud[1], noeud[2]);
|
||||
Tr->Triangle(i).Get(noeud[0], noeud[1], noeud[2]);
|
||||
|
||||
P[0] = Nodes(noeud[0]).Transformed(L.Transformation());
|
||||
P[0] = Tr->Node(noeud[0]).Transformed(L.Transformation());
|
||||
z[0] = P[0].Z();
|
||||
P[1] = Nodes(noeud[1]).Transformed(L.Transformation());
|
||||
P[1] = Tr->Node(noeud[1]).Transformed(L.Transformation());
|
||||
z[1] = P[1].Z();
|
||||
P[2] = Nodes(noeud[2]).Transformed(L.Transformation());
|
||||
P[2] = Tr->Node(noeud[2]).Transformed(L.Transformation());
|
||||
z[2] = P[2].Z();
|
||||
|
||||
// Determination des cas aux limites pour les triangles
|
||||
|
@ -41,7 +41,13 @@
|
||||
#include <TColgp_SequenceOfXYZ.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#else
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#endif
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
@ -117,9 +123,15 @@ TopoDS_Shape AdvancedEngine_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed
|
||||
|
||||
GeomPlate_BuildPlateSurface aBuilder(3,10);
|
||||
// ** Initialization of surface
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(BRepAdaptor_HSurface) HSI = new BRepAdaptor_HSurface();
|
||||
HSI->ChangeSurface().Initialize(aInitShape);
|
||||
aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->ChangeSurface().Face()));
|
||||
#else
|
||||
Handle(BRepAdaptor_Surface) HSI = new BRepAdaptor_Surface();
|
||||
HSI->Initialize(aInitShape);
|
||||
aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->Face()) );
|
||||
#endif
|
||||
|
||||
Standard_Integer j, j1, j2;
|
||||
// cout << "Init surface" << endl;
|
||||
|
@ -73,9 +73,13 @@
|
||||
|
||||
#include <TColGeom_HArray2OfSurface.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomLib_IsPlanarSurface.hxx>
|
||||
#else
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#endif
|
||||
|
||||
#include <GeomLib_IsPlanarSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
@ -85,7 +89,9 @@
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#endif
|
||||
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||
#include <GeomConvert_ApproxSurface.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
@ -300,7 +306,11 @@ static Standard_Boolean IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
|
||||
// Computation of the number of samples on the edge.
|
||||
BRepAdaptor_Surface aBAS(theFace);
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(aBAS);
|
||||
#else
|
||||
Handle(BRepAdaptor_Surface) aBAHS = new BRepAdaptor_Surface(aBAS);
|
||||
#endif
|
||||
Handle(BRepTopAdaptor_TopolTool) aTool = new BRepTopAdaptor_TopolTool(aBAHS);
|
||||
Standard_Integer aNbSamples = aTool->NbSamples();
|
||||
const Standard_Integer aNbSamplesMax = 23;
|
||||
@ -903,8 +913,13 @@ Standard_Boolean BlockFix_UnionFaces::IsSameDomain(const TopoDS_Face& aFace,
|
||||
if (S1->IsKind(STANDARD_TYPE(Geom_ElementarySurface)) &&
|
||||
S2->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
|
||||
{
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(GeomAdaptor_HSurface) aGA1 = new GeomAdaptor_HSurface(S1);
|
||||
Handle(GeomAdaptor_HSurface) aGA2 = new GeomAdaptor_HSurface(S2);
|
||||
#else
|
||||
Handle(GeomAdaptor_Surface) aGA1 = new GeomAdaptor_Surface(S1);
|
||||
Handle(GeomAdaptor_Surface) aGA2 = new GeomAdaptor_Surface(S2);
|
||||
#endif
|
||||
|
||||
Handle(BRepTopAdaptor_TopolTool) aTT1 = new BRepTopAdaptor_TopolTool();
|
||||
Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
|
||||
|
@ -191,7 +191,7 @@ void AIS_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentati
|
||||
asp->Aspect()->SetTextZoomable(aZoomable);
|
||||
asp->Aspect()->SetTextAngle(aAngle);
|
||||
asp->Aspect()->SetTextFontAspect(aFontAspect);
|
||||
Prs3d_Text::Draw(aPresentation, asp, aText, aPosition); // todo: deprecated OCCT API
|
||||
Prs3d_Text::Draw(aPresentation->CurrentGroup(), asp, aText, aPosition);
|
||||
}
|
||||
|
||||
bool isSame (double d1, double d2)
|
||||
|
@ -616,14 +616,12 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
|
||||
}
|
||||
//
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
|
||||
//
|
||||
// map link/nbtriangles
|
||||
j1=aTrs.Lower();
|
||||
j2=aTrs.Upper();
|
||||
j1 = 1;
|
||||
j2 = aTRF->NbTriangles();
|
||||
for (j=j1; j<=j2; ++j) {
|
||||
const Poly_Triangle& aTr=aTrs(j);
|
||||
const Poly_Triangle& aTr = aTRF->Triangle(j);
|
||||
aTr.Get(n[0], n[1], n[2]);
|
||||
n[3]=n[0];
|
||||
for (k=0; k<3; ++k) {
|
||||
@ -655,11 +653,11 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
|
||||
}
|
||||
//
|
||||
// inner nodes=all_nodes - boundary_nodes
|
||||
j1=aNodes.Lower();
|
||||
j2=aNodes.Upper();
|
||||
j1=1;
|
||||
j2=aTRF->NbNodes();
|
||||
for (j=j1; j<=j2; ++j) {
|
||||
if (!aMBN.Contains(j)) {
|
||||
aP=aNodes(j).Transformed(aTrsf);
|
||||
aP=aTRF->Node(j).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
@ -769,13 +767,12 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
||||
}
|
||||
else {
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||
//
|
||||
aNbNodes=aPTE->NbNodes();
|
||||
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||
for (j=2; j<aNbNodes; ++j) {
|
||||
aIndex=aInds(j);
|
||||
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||
aP=aTRE->Node(aIndex).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,9 @@
|
||||
#include <BOPAlgo_Builder.hxx>
|
||||
|
||||
#include <GEOMAlgo_AlgoTools.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_ShellSolidBuilder
|
||||
@ -70,7 +73,12 @@ class GEOMAlgo_ShellSolidBuilder : public BOPAlgo_Builder {
|
||||
|
||||
protected:
|
||||
Standard_EXPORT
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
virtual void PerformInternal(const BOPAlgo_PaveFiller& theFiller);
|
||||
#else
|
||||
virtual void PerformInternal(const BOPAlgo_PaveFiller& theFiller,
|
||||
const Message_ProgressRange& theRange);
|
||||
#endif
|
||||
};
|
||||
|
||||
//=======================================================================
|
||||
@ -93,9 +101,13 @@ GEOMAlgo_ShellSolidBuilder::~GEOMAlgo_ShellSolidBuilder()
|
||||
//function : PerformInternal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
|
||||
#else
|
||||
void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFiller,
|
||||
const Message_ProgressRange& theRange)
|
||||
#endif
|
||||
{
|
||||
//
|
||||
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
|
||||
myDS=myPaveFiller->PDS();
|
||||
myContext=myPaveFiller->Context();
|
||||
@ -111,10 +123,21 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if OCC_VERSION_LARGE >= 0x07070000
|
||||
Message_ProgressScope aPS(theRange, "Building the result of Boolean operation", 100);
|
||||
//
|
||||
BOPAlgo_PISteps aSteps (PIOperation_Last);
|
||||
analyzeProgress (100, aSteps);
|
||||
#endif
|
||||
|
||||
// 3. Fill Images
|
||||
// 3.1 Vertice
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
FillImagesVertices();
|
||||
#else
|
||||
FillImagesVertices(aPS.Next(aSteps.GetStep(PIOperation_TreatVertices)));
|
||||
#endif
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
}
|
||||
@ -124,7 +147,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
|
||||
return;
|
||||
}
|
||||
// 3.2 Edges
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
FillImagesEdges();
|
||||
#else
|
||||
FillImagesEdges(aPS.Next(aSteps.GetStep(PIOperation_TreatEdges)));
|
||||
#endif
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
}
|
||||
@ -135,7 +162,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
|
||||
}
|
||||
//
|
||||
// 3.3 Wires
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
FillImagesContainers(TopAbs_WIRE);
|
||||
#else
|
||||
FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps.GetStep(PIOperation_TreatWires)));
|
||||
#endif
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
}
|
||||
@ -146,7 +177,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
|
||||
}
|
||||
|
||||
// 3.4 Faces
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
FillImagesFaces();
|
||||
#else
|
||||
FillImagesFaces(aPS.Next(aSteps.GetStep(PIOperation_TreatFaces)));
|
||||
#endif
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
}
|
||||
|
@ -180,7 +180,11 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
|
||||
//function : PostTreat
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
void GEOMAlgo_Splitter::PostTreat()
|
||||
#else
|
||||
void GEOMAlgo_Splitter::PostTreat(const Message_ProgressRange& theRange)
|
||||
#endif
|
||||
{
|
||||
if (myLimit!=TopAbs_SHAPE) {
|
||||
Standard_Integer i, aNbS;
|
||||
@ -282,7 +286,11 @@ void GEOMAlgo_Splitter::PostTreat()
|
||||
myShape=aLS.First();
|
||||
}
|
||||
//
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
BOPAlgo_Builder::PostTreat();
|
||||
#else
|
||||
BOPAlgo_Builder::PostTreat(theRange);
|
||||
#endif
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TreatCompound
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
#include <BOPAlgo_Builder.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_Splitter
|
||||
//purpose :
|
||||
@ -85,7 +87,11 @@ class GEOMAlgo_Splitter : public BOPAlgo_Builder
|
||||
virtual void BuildResult(const TopAbs_ShapeEnum theType);
|
||||
|
||||
Standard_EXPORT
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
virtual void PostTreat();
|
||||
#else
|
||||
virtual void PostTreat(const Message_ProgressRange& theRange);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
TopTools_ListOfShape myTools;
|
||||
|
@ -30,6 +30,14 @@
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_HArray1OfExtendedString.hxx>
|
||||
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class GEOM_Object;
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
#include <ShapeFix_Face.hxx>
|
||||
@ -85,7 +87,11 @@
|
||||
#include <Geom_Conic.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#else
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#endif
|
||||
#include <GeomFill_BSplineCurves.hxx>
|
||||
#include <GeomConvert_ApproxCurve.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
@ -160,7 +166,11 @@ static GeomFill_Trihedron EvaluateBestSweepMode(const TopoDS_Shape& Spine)
|
||||
Standard_Real fpar, lpar;
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
|
||||
GeomAdaptor_Curve GAcurve(aCurve, fpar, lpar);
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(GeomAdaptor_HCurve) GAHcurve = new GeomAdaptor_HCurve(GAcurve);
|
||||
#else
|
||||
Handle(GeomAdaptor_Curve) GAHcurve = new GeomAdaptor_Curve(GAcurve);
|
||||
#endif
|
||||
|
||||
Handle(GeomFill_CorrectedFrenet) aCorrFrenet = new GeomFill_CorrectedFrenet(Standard_True); //for evaluation
|
||||
aCorrFrenet->SetCurve(GAHcurve);
|
||||
|
@ -24,13 +24,20 @@
|
||||
|
||||
#include <GEOMImpl_ProjectionDriver.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include <GEOMImpl_IMirror.hxx>
|
||||
#include <GEOMImpl_IProjection.hxx>
|
||||
#include <GEOMImpl_IProjOnCyl.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <GEOMUtils_HTrsfCurve2d.hxx>
|
||||
#else
|
||||
#include <GEOMUtils_TrsfCurve2d.hxx>
|
||||
#endif
|
||||
|
||||
#include <Approx_Curve2d.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
@ -661,8 +668,14 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
|
||||
}
|
||||
|
||||
// Transform the curve to cylinder's parametric space.
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(GEOMUtils::HTrsfCurve2d) aTrsfCurve =
|
||||
new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
|
||||
#else
|
||||
Handle(GEOMUtils::TrsfCurve2d) aTrsfCurve =
|
||||
new GEOMUtils::TrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
|
||||
#endif
|
||||
|
||||
Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1],
|
||||
aUResol, aVResol, GeomAbs_C1,
|
||||
9, 1000);
|
||||
|
@ -96,8 +96,6 @@
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include <V3d_Coordinate.hxx>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||
@ -1095,7 +1093,7 @@ gp_Pnt GEOMUtils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
|
||||
// inside V3d_View::FitMinMax() method. It's by occt design.
|
||||
// So, we should use camera direction instead.
|
||||
|
||||
V3d_Coordinate XAt, YAt, ZAt;
|
||||
Standard_Real XAt, YAt, ZAt;
|
||||
aView->At(XAt, YAt, ZAt);
|
||||
gp_Pnt AtPoint(XAt, YAt, ZAt);
|
||||
|
||||
|
@ -18,6 +18,10 @@
|
||||
//
|
||||
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
|
||||
#include <GEOMUtils_HTrsfCurve2d.hxx>
|
||||
|
||||
namespace GEOMUtils {
|
||||
@ -45,3 +49,5 @@ GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
|
||||
: myCurve (theCurve, theUFirst, theULast, theTrsf)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -21,6 +21,10 @@
|
||||
#define _GEOMUtils_HTrsfCurve2d_HXX_
|
||||
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
|
||||
#include <GEOMUtils_TrsfCurve2d.hxx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
@ -78,3 +82,5 @@ namespace GEOMUtils
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -19,7 +19,15 @@
|
||||
|
||||
|
||||
#include <GEOMUtils_TrsfCurve2d.hxx>
|
||||
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <GEOMUtils_HTrsfCurve2d.hxx>
|
||||
#else
|
||||
IMPLEMENT_STANDARD_RTTIEXT(GEOMUtils::TrsfCurve2d, Adaptor2d_Curve2d)
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : TrsfCurve2d
|
||||
@ -134,6 +142,7 @@ void GEOMUtils::TrsfCurve2d::Intervals(TColStd_Array1OfReal &T,
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim
|
||||
(const Standard_Real First, const Standard_Real Last,
|
||||
const Standard_Real /*Tol*/) const
|
||||
@ -144,6 +153,18 @@ Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim
|
||||
|
||||
return aAHCurve;
|
||||
}
|
||||
#else
|
||||
Handle(Adaptor2d_Curve2d) GEOMUtils::TrsfCurve2d::Trim
|
||||
(const Standard_Real First, const Standard_Real Last,
|
||||
const Standard_Real /*Tol*/) const
|
||||
{
|
||||
Handle(Geom2d_Curve) aCurve = myCurve.Curve();
|
||||
Handle(GEOMUtils::TrsfCurve2d) aAHCurve =
|
||||
new GEOMUtils::TrsfCurve2d(aCurve, First, Last, myTrsf);
|
||||
|
||||
return aAHCurve;
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
|
||||
namespace GEOMUtils
|
||||
{
|
||||
@ -37,6 +39,9 @@ namespace GEOMUtils
|
||||
*/
|
||||
class TrsfCurve2d : public Adaptor2d_Curve2d
|
||||
{
|
||||
#if OCC_VERSION_LARGE >= 0x07070000
|
||||
DEFINE_STANDARD_RTTIEXT(TrsfCurve2d, Adaptor2d_Curve2d)
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
@ -109,7 +114,11 @@ namespace GEOMUtils
|
||||
/**
|
||||
* Redefined method from the base class.
|
||||
*/
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim
|
||||
#else
|
||||
Standard_EXPORT Handle(Adaptor2d_Curve2d) Trim
|
||||
#endif
|
||||
(const Standard_Real First, const Standard_Real Last,
|
||||
const Standard_Real ) const;
|
||||
|
||||
@ -233,6 +242,11 @@ namespace GEOMUtils
|
||||
Trsf2d myTrsf;
|
||||
|
||||
};
|
||||
|
||||
#if OCC_VERSION_LARGE >= 0x07070000
|
||||
DEFINE_STANDARD_HANDLE(TrsfCurve2d, Adaptor2d_Curve2d)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// function : Constructor
|
||||
|
@ -712,15 +712,13 @@ Standard_Boolean GEOM_AISShape::computeMassCenter( const TopoDS_Shape& theShape,
|
||||
{
|
||||
gp_XY C( 0, 0 );
|
||||
double A = 0;
|
||||
const TColgp_Array1OfPnt2d& uvArray = triangulation->UVNodes();
|
||||
const Poly_Array1OfTriangle& trias = triangulation->Triangles();
|
||||
Standard_Integer n1,n2,n3;
|
||||
for ( int iT = trias.Lower(); iT <= trias.Upper(); ++iT )
|
||||
for ( int iT = 1; iT <= triangulation->NbTriangles(); ++iT )
|
||||
{
|
||||
trias( iT ).Get( n1,n2,n3 );
|
||||
const gp_Pnt2d& uv1 = uvArray( n1 );
|
||||
const gp_Pnt2d& uv2 = uvArray( n2 );
|
||||
const gp_Pnt2d& uv3 = uvArray( n3 );
|
||||
triangulation->Triangle( iT ).Get( n1,n2,n3 );
|
||||
const gp_Pnt2d& uv1 = triangulation->UVNode( n1 );
|
||||
const gp_Pnt2d& uv2 = triangulation->UVNode( n2 );
|
||||
const gp_Pnt2d& uv3 = triangulation->UVNode( n3 );
|
||||
double a = 0.5 * sqrt(( uv1.X() - uv3.X() ) * ( uv2.Y() - uv1.Y() ) -
|
||||
( uv1.X() - uv2.X() ) * ( uv3.Y() - uv1.Y() ));
|
||||
C += ( uv1.XY() + uv2.XY() + uv3.XY() ) / 3. * a;
|
||||
|
@ -711,24 +711,21 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
const OpenGl_Aspects* anAspect = theWorkspace->Aspects();
|
||||
|
||||
// getting string size will also initialize font library
|
||||
#if OCC_VERSION_LARGE >= 0x07040000
|
||||
#if OCC_VERSION_LARGE >= 0x07070000
|
||||
Font_Hinting aFH = theWorkspace->View()->RenderingParams().FontHinting;
|
||||
myTextDraw->StringSize( aContext,
|
||||
myText, *anAspect, myTextParams->Height(), aDPI,
|
||||
myText, *anAspect, myTextParams->Height(), aDPI, aFH,
|
||||
myTextSize.x, myTextSize.a, myTextSize.d );
|
||||
#else
|
||||
myTextDraw->StringSize( aContext,
|
||||
myText, *anAspect, myTextParams, aDPI,
|
||||
myText, *anAspect, myTextParams->Height(), aDPI,
|
||||
myTextSize.x, myTextSize.a, myTextSize.d );
|
||||
#endif
|
||||
|
||||
myTextDPI = aDPI;
|
||||
myTextSize.y = myTextSize.a - myTextSize.d;
|
||||
|
||||
# if OCC_VERSION_LARGE >= 0x07040000
|
||||
switch ( myTextParams->HorizontalAlignment() )
|
||||
#else
|
||||
switch (myTextParams.HAlign)
|
||||
#endif
|
||||
{
|
||||
case Graphic3d_HTA_LEFT: myTextUnderline.x() = 0.f; break;
|
||||
case Graphic3d_HTA_CENTER: myTextUnderline.x() = -myTextSize.x / 2.f; break;
|
||||
@ -737,11 +734,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
break;
|
||||
}
|
||||
|
||||
# if OCC_VERSION_LARGE >= 0x07040000
|
||||
switch ( myTextParams->VerticalAlignment() )
|
||||
#else
|
||||
switch (myTextParams.VAlign)
|
||||
#endif
|
||||
{
|
||||
case Graphic3d_VTA_TOPFIRSTLINE:
|
||||
case Graphic3d_VTA_TOP: myTextUnderline.y() = -myTextSize.y; break;
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include <GEOMUtils_Hatcher.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkCellArray.h>
|
||||
@ -39,7 +41,11 @@
|
||||
#include <vtkInformationVector.h>
|
||||
|
||||
// OpenCASCADE Includes
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#else
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#endif
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
@ -622,10 +628,9 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
} else {
|
||||
nbnodes = aEdgePoly->NbNodes();
|
||||
const TColStd_Array1OfInteger& Nodesidx = aEdgePoly->Nodes();
|
||||
const TColgp_Array1OfPnt& theNodesPoly = T->Nodes();
|
||||
|
||||
aP1 = theNodesPoly(1);
|
||||
aP2 = theNodesPoly(nbnodes);
|
||||
aP1 = T->Node(1);
|
||||
aP2 = T->Node(nbnodes);
|
||||
|
||||
float coord[3];
|
||||
vtkIdType pts[2];
|
||||
@ -634,8 +639,8 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
Standard_Integer id1 = Nodesidx(j);
|
||||
Standard_Integer id2 = Nodesidx(j+1);
|
||||
|
||||
gp_Pnt pt1 = theNodesPoly(id1);
|
||||
gp_Pnt pt2 = theNodesPoly(id2);
|
||||
gp_Pnt pt1 = T->Node(id1);
|
||||
gp_Pnt pt2 = T->Node(id2);
|
||||
|
||||
if(!isidtrsf) {
|
||||
// apply edge transformation
|
||||
@ -854,12 +859,9 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
|
||||
Standard_Integer nbNodesInFace = aPoly->NbNodes();
|
||||
Standard_Integer nbTriInFace = aPoly->NbTriangles();
|
||||
|
||||
const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
|
||||
const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
|
||||
|
||||
Standard_Integer i;
|
||||
for(i=1;i<=nbNodesInFace;i++) {
|
||||
gp_Pnt P = Nodes(i);
|
||||
gp_Pnt P = aPoly->Node(i);
|
||||
float coord[3];
|
||||
if(!identity) P.Transform(myTransf);
|
||||
coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
|
||||
@ -870,7 +872,7 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
|
||||
// Get the triangle
|
||||
|
||||
Standard_Integer N1,N2,N3;
|
||||
Triangles(i).Get(N1,N2,N3);
|
||||
aPoly->Triangle(i).Get(N1,N2,N3);
|
||||
|
||||
vtkIdType pts[3];
|
||||
pts[0] = N1-1; pts[1] = N2-1; pts[2] = N3-1;
|
||||
|
@ -138,17 +138,16 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
|
||||
} else {
|
||||
Standard_Integer aNbNodes = aEdgePoly->NbNodes();
|
||||
const TColStd_Array1OfInteger& aNodeIds = aEdgePoly->Nodes();
|
||||
const TColgp_Array1OfPnt& anId2Pnts = T->Nodes();
|
||||
|
||||
aP1 = anId2Pnts(aNodeIds(1));
|
||||
aP2 = anId2Pnts(aNodeIds(aNbNodes));
|
||||
aP1 = T->Node(aNodeIds(1));
|
||||
aP2 = T->Node(aNodeIds(aNbNodes));
|
||||
|
||||
for(int j = 1; j < aNbNodes; j++) {
|
||||
Standard_Integer id1 = aNodeIds(j);
|
||||
Standard_Integer id2 = aNodeIds(j+1);
|
||||
|
||||
gp_Pnt pt1 = anId2Pnts(id1);
|
||||
gp_Pnt pt2 = anId2Pnts(id2);
|
||||
gp_Pnt pt1 = T->Node(id1);
|
||||
gp_Pnt pt2 = T->Node(id2);
|
||||
|
||||
if(!isidtrsf) {
|
||||
// apply edge transformation
|
||||
|
@ -85,21 +85,19 @@ OCC2VTK(const TopoDS_Face& theFace,
|
||||
|
||||
Standard_Integer i;
|
||||
int aNbOfNodes = thePts->GetNumberOfPoints();
|
||||
const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
|
||||
Standard_Integer nbNodesInFace = aPoly->NbNodes();
|
||||
for(i = 1; i <= nbNodesInFace; i++) {
|
||||
gp_Pnt P = Nodes(i);
|
||||
gp_Pnt P = aPoly->Node(i);
|
||||
if(!identity)
|
||||
P.Transform(myTransf);
|
||||
thePts->InsertNextPoint(P.X(),P.Y(),P.Z());
|
||||
}
|
||||
|
||||
const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
|
||||
Standard_Integer nbTriInFace = aPoly->NbTriangles();
|
||||
for(i = 1; i <= nbTriInFace; i++){
|
||||
// Get the triangle
|
||||
Standard_Integer N1,N2,N3;
|
||||
Triangles(i).Get(N1,N2,N3);
|
||||
aPoly->Triangle(i).Get(N1,N2,N3);
|
||||
N1 += aNbOfNodes - 1;
|
||||
N2 += aNbOfNodes - 1;
|
||||
N3 += aNbOfNodes - 1;
|
||||
|
@ -31,10 +31,17 @@
|
||||
#include <vtkInformation.h>
|
||||
#include <vtkInformationVector.h>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#else
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#endif
|
||||
|
||||
vtkStandardNewMacro(GEOM_WireframeFace)
|
||||
|
||||
GEOM_WireframeFace::GEOM_WireframeFace():
|
||||
|
@ -29,9 +29,13 @@
|
||||
#include <ShHealOper_FillHoles.hxx>
|
||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
#include <BRepAdaptor_HCurve.hxx>
|
||||
#endif
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepFill_CurveConstraint.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
@ -284,7 +288,11 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi
|
||||
|
||||
TopoDS_Edge ae = TopoDS::Edge(aIter.Value());
|
||||
BRepAdaptor_Curve adC(ae);
|
||||
Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC);
|
||||
#if OCC_VERSION_LARGE < 0x07070000
|
||||
Handle(BRepAdaptor_HCurve) aHAD = new BRepAdaptor_HCurve(adC);
|
||||
#else
|
||||
Handle(BRepAdaptor_Curve) aHAD = new BRepAdaptor_Curve(adC);
|
||||
#endif
|
||||
// Handle(BRepFill_CurveConstraint) aConst =
|
||||
// new BRepFill_CurveConstraint (Handle(Adaptor3d_HCurve)::DownCast(aHAD), (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
|
||||
Handle(GeomPlate_CurveConstraint) aConst =
|
||||
|
Loading…
Reference in New Issue
Block a user