mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0033491: Data Exchange, Step Import - Incorrect import of ComplexTriangulatedFace
Reading and writing of triangle_strips and triangle_fans has been corrected in RWStepVisual_RWComplexTriangulatedFace.cxx file. And corresponding corrections have been added to other files.
This commit is contained in:
parent
f0c6e6fc8d
commit
588ee924e4
@ -27,7 +27,7 @@
|
||||
#include <Standard_Real.hxx>
|
||||
#include <StepVisual_FaceOrSurface.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray2OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfTransient.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepVisual_RWComplexTriangulatedFace
|
||||
@ -118,15 +118,16 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste
|
||||
}
|
||||
}
|
||||
|
||||
Handle(TColStd_HArray2OfInteger) aTriangleStrips;
|
||||
Handle(TColStd_HArray1OfTransient) aTriangleStrips;
|
||||
Standard_Integer sub7 = 0;
|
||||
if (theData->ReadSubList(theNum, 7, "triangle_strips", theCheck, sub7))
|
||||
{
|
||||
Standard_Integer nb0 = theData->NbParams(sub7);
|
||||
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub7,1));
|
||||
aTriangleStrips = new TColStd_HArray2OfInteger(1, nb0, 1, nbj0);
|
||||
aTriangleStrips = new TColStd_HArray1OfTransient(1, nb0);
|
||||
for (Standard_Integer i0 = 1; i0 <= nb0; i0++)
|
||||
{
|
||||
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub7, i0));
|
||||
Handle(TColStd_HArray1OfInteger) aSingleTriangleStrip = new TColStd_HArray1OfInteger(1, nbj0);
|
||||
Standard_Integer subj7 = 0;
|
||||
if ( theData->ReadSubList (sub7, i0, "sub-part(triangle_strips)", theCheck, subj7) ) {
|
||||
Standard_Integer num4 = subj7;
|
||||
@ -134,21 +135,23 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste
|
||||
{
|
||||
Standard_Integer anIt0;
|
||||
theData->ReadInteger(num4, j0, "integer", theCheck, anIt0);
|
||||
aTriangleStrips->SetValue(i0,j0, anIt0);
|
||||
aSingleTriangleStrip->SetValue(j0, anIt0);
|
||||
}
|
||||
aTriangleStrips->SetValue(i0, aSingleTriangleStrip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Handle(TColStd_HArray2OfInteger) aTriangleFans;
|
||||
Handle(TColStd_HArray1OfTransient) aTriangleFans;
|
||||
Standard_Integer sub8 = 0;
|
||||
if (theData->ReadSubList(theNum, 8, "triangle_fans", theCheck, sub8))
|
||||
{
|
||||
Standard_Integer nb0 = theData->NbParams(sub8);
|
||||
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub8,1));
|
||||
aTriangleFans = new TColStd_HArray2OfInteger(1, nb0, 1, nbj0);
|
||||
aTriangleFans = new TColStd_HArray1OfTransient(1, nb0);
|
||||
for (Standard_Integer i0 = 1; i0 <= nb0; i0++)
|
||||
{
|
||||
Standard_Integer nbj0 = theData->NbParams(theData->ParamNumber(sub8, i0));
|
||||
Handle(TColStd_HArray1OfInteger) aSingleTriangleFan = new TColStd_HArray1OfInteger(1, nbj0);
|
||||
Standard_Integer subj8 = 0;
|
||||
if ( theData->ReadSubList (sub8, i0, "sub-part(triangle_fans)", theCheck, subj8) ) {
|
||||
Standard_Integer num4 = subj8;
|
||||
@ -156,8 +159,9 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste
|
||||
{
|
||||
Standard_Integer anIt0;
|
||||
theData->ReadInteger(num4, j0, "integer", theCheck, anIt0);
|
||||
aTriangleFans->SetValue(i0,j0, anIt0);
|
||||
aSingleTriangleFan->SetValue(j0, anIt0);
|
||||
}
|
||||
aTriangleFans->SetValue(i0, aSingleTriangleFan);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -219,13 +223,14 @@ void RWStepVisual_RWComplexTriangulatedFace::WriteStep (StepData_StepWriter& the
|
||||
theSW.CloseSub();
|
||||
|
||||
theSW.OpenSub();
|
||||
for (Standard_Integer i6 = 1; i6 <= theEnt->TriangleStrips()->RowLength(); i6++)
|
||||
for (Standard_Integer i6 = 1; i6 <= theEnt->NbTriangleStrips(); i6++)
|
||||
{
|
||||
theSW.NewLine(Standard_False);
|
||||
theSW.OpenSub();
|
||||
for (Standard_Integer j6 = 1; j6 <= theEnt->TriangleStrips()->ColLength(); j6++)
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(theEnt->TriangleStrips()->Value(i6));
|
||||
for (Standard_Integer j6 = 1; j6 <= aTriangleStrip->Length(); j6++)
|
||||
{
|
||||
Standard_Integer Var0 = theEnt->TriangleStrips()->Value(i6,j6);
|
||||
Standard_Integer Var0 = aTriangleStrip->Value(j6);
|
||||
theSW.Send(Var0);
|
||||
}
|
||||
theSW.CloseSub();
|
||||
@ -233,13 +238,14 @@ void RWStepVisual_RWComplexTriangulatedFace::WriteStep (StepData_StepWriter& the
|
||||
theSW.CloseSub();
|
||||
|
||||
theSW.OpenSub();
|
||||
for (Standard_Integer i7 = 1; i7 <= theEnt->TriangleFans()->RowLength(); i7++)
|
||||
for (Standard_Integer i7 = 1; i7 <= theEnt->NbTriangleFans(); i7++)
|
||||
{
|
||||
theSW.NewLine(Standard_False);
|
||||
theSW.OpenSub();
|
||||
for (Standard_Integer j7 = 1; j7 <= theEnt->TriangleFans()->ColLength(); j7++)
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(theEnt->TriangleFans()->Value(i7));
|
||||
for (Standard_Integer j7 = 1; j7 <= aTriangleFan->Length(); j7++)
|
||||
{
|
||||
Standard_Integer Var0 = theEnt->TriangleFans()->Value(i7,j7);
|
||||
Standard_Integer Var0 = aTriangleFan->Value(j7);
|
||||
theSW.Send(Var0);
|
||||
}
|
||||
theSW.CloseSub();
|
||||
|
@ -114,11 +114,13 @@ Interface_EntityIterator& theIter) const
|
||||
{
|
||||
|
||||
// Inherited fields of Representation
|
||||
|
||||
for (Standard_Integer i1 = 1; i1 <= theEnt->StepRepr_Representation::Items()->Length(); i1++)
|
||||
if (!theEnt->StepRepr_Representation::Items().IsNull())
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) Var0 = theEnt->StepRepr_Representation::Items()->Value(i1);
|
||||
theIter.AddItem(Var0);
|
||||
for (Standard_Integer i1 = 1; i1 <= theEnt->StepRepr_Representation::Items()->Length(); i1++)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) Var0 = theEnt->StepRepr_Representation::Items()->Value(i1);
|
||||
theIter.AddItem(Var0);
|
||||
}
|
||||
}
|
||||
|
||||
theIter.AddItem(theEnt->StepRepr_Representation::ContextOfItems());
|
||||
|
@ -108,7 +108,6 @@ namespace {
|
||||
Handle(TColStd_HArray1OfInteger)& thePnindices,
|
||||
const Standard_Real theLengthFactor)
|
||||
{
|
||||
//const Standard_Real aLF = StepData_GlobalFactors::Intance().LengthFactor();
|
||||
for (Standard_Integer aPnIndex = 1; aPnIndex <= theMesh->NbNodes(); ++aPnIndex)
|
||||
{
|
||||
const gp_XYZ& aPoint = theNodes->Value(thePnindices->Value(aPnIndex));
|
||||
@ -152,72 +151,6 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : SetTriangles
|
||||
// Purpose : Set triangles to the triangulation from an array
|
||||
// ============================================================================
|
||||
static void SetTriangles(const Handle(Poly_Triangulation)& theMesh,
|
||||
const Handle(TColStd_HArray2OfInteger) theTriangles,
|
||||
const Standard_Integer theTrianStripsNum,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTrianStrips,
|
||||
const Standard_Integer theTrianFansNum,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTrianFans)
|
||||
{
|
||||
if (theTrianStripsNum == 0 && theTrianFansNum == 0)
|
||||
{
|
||||
for (Standard_Integer aTrianIndex = 1; aTrianIndex <= theMesh->NbTriangles(); ++aTrianIndex)
|
||||
{
|
||||
theMesh->SetTriangle(aTrianIndex,
|
||||
Poly_Triangle(theTriangles->Value(aTrianIndex, 1),
|
||||
theTriangles->Value(aTrianIndex, 2),
|
||||
theTriangles->Value(aTrianIndex, 3)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Integer aTriangleIndex = 1;
|
||||
for (Standard_Integer aTrianStripIndex = 1; aTrianStripIndex <= theTrianStripsNum; ++aTrianStripIndex)
|
||||
{
|
||||
for (Standard_Integer anUCIndex = 3; anUCIndex <= theTrianStrips->UpperCol(); anUCIndex += 2)
|
||||
{
|
||||
if (theTrianStrips->Value(aTrianStripIndex, anUCIndex) != theTrianStrips->Value(aTrianStripIndex, anUCIndex - 2) &&
|
||||
theTrianStrips->Value(aTrianStripIndex, anUCIndex) != theTrianStrips->Value(aTrianStripIndex, anUCIndex - 1))
|
||||
{
|
||||
theMesh->SetTriangle(aTriangleIndex++,
|
||||
Poly_Triangle(theTrianStrips->Value(aTrianStripIndex, anUCIndex - 2),
|
||||
theTrianStrips->Value(aTrianStripIndex, anUCIndex),
|
||||
theTrianStrips->Value(aTrianStripIndex, anUCIndex - 1)));
|
||||
}
|
||||
}
|
||||
for (Standard_Integer anUCIndex = 4; anUCIndex <= theTrianStrips->UpperCol(); anUCIndex += 2)
|
||||
{
|
||||
if (theTrianStrips->Value(aTrianStripIndex, anUCIndex) != theTrianStrips->Value(aTrianStripIndex, anUCIndex - 2)
|
||||
&& theTrianStrips->Value(aTrianStripIndex, anUCIndex) != theTrianStrips->Value(aTrianStripIndex, anUCIndex - 1))
|
||||
{
|
||||
theMesh->SetTriangle(aTriangleIndex++,
|
||||
Poly_Triangle(theTrianStrips->Value(aTrianStripIndex, anUCIndex - 2),
|
||||
theTrianStrips->Value(aTrianStripIndex, anUCIndex - 1),
|
||||
theTrianStrips->Value(aTrianStripIndex, anUCIndex)));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Standard_Integer aTrianFanIndex = 1; aTrianFanIndex <= theTrianFansNum; ++aTrianFanIndex)
|
||||
{
|
||||
for (Standard_Integer anUCIndex = 3; anUCIndex <= theTrianFans->UpperCol(); ++anUCIndex)
|
||||
{
|
||||
if (theTrianFans->Value(aTrianFanIndex, anUCIndex) != theTrianFans->Value(aTrianFanIndex, anUCIndex - 2)
|
||||
&& theTrianFans->Value(aTrianFanIndex, anUCIndex - 1) != theTrianFans->Value(aTrianFanIndex, anUCIndex - 2))
|
||||
{
|
||||
theMesh->SetTriangle(aTriangleIndex++,
|
||||
Poly_Triangle(theTrianStrips->Value(aTrianFanIndex, anUCIndex - 2),
|
||||
theTrianStrips->Value(aTrianFanIndex, anUCIndex - 1),
|
||||
theTrianStrips->Value(aTrianFanIndex, anUCIndex)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : SetTriangles
|
||||
// Purpose : Set triangles to the triangulation from an array
|
||||
@ -273,9 +206,9 @@ namespace {
|
||||
if (aTriangleFan->Value(anIndex) != aTriangleFan->Value(anIndex - 2) &&
|
||||
aTriangleFan->Value(anIndex - 1) != aTriangleFan->Value(anIndex - 2))
|
||||
{
|
||||
theMesh->SetTriangle(aTriangleIndex++, Poly_Triangle(aTriangleFan->Value(anIndex - 2),
|
||||
aTriangleFan->Value(anIndex - 1),
|
||||
aTriangleFan->Value(anIndex)));
|
||||
theMesh->SetTriangle(aTriangleIndex++, Poly_Triangle(aTriangleFan->Value(1),
|
||||
aTriangleFan->Value(anIndex),
|
||||
aTriangleFan->Value(anIndex - 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -317,8 +250,8 @@ namespace {
|
||||
static void GetComplexFaceElements(Type theFace,
|
||||
Handle(TColgp_HArray1OfXYZ)& theNodes,
|
||||
Handle(TColStd_HArray2OfReal)& theNormals,
|
||||
Handle(TColStd_HArray2OfInteger)& theTriangleStrips,
|
||||
Handle(TColStd_HArray2OfInteger)& theTriangleFans,
|
||||
Handle(TColStd_HArray1OfTransient)& theTriangleStrips,
|
||||
Handle(TColStd_HArray1OfTransient)& theTriangleFans,
|
||||
Standard_Integer& thePnIndNb,
|
||||
Standard_Integer& theNormNb,
|
||||
Standard_Integer& theTriStripsNb,
|
||||
@ -340,37 +273,6 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : GetComplexFaceSetElements
|
||||
// Purpose : Get elements from complex face
|
||||
// ============================================================================
|
||||
template<class Type>
|
||||
static void GetComplexFaceSetElements(Type theFace,
|
||||
Handle(TColgp_HArray1OfXYZ)& theNodes,
|
||||
Handle(TColStd_HArray2OfReal)& theNormals,
|
||||
Handle(TColStd_HArray1OfTransient)& theTriangleStrips,
|
||||
Handle(TColStd_HArray1OfTransient)& theTriangleFans,
|
||||
Standard_Integer& thePnIndNb,
|
||||
Standard_Integer& theNormNb,
|
||||
Standard_Integer& theTriStripsNb,
|
||||
Standard_Integer& theTriFansNb,
|
||||
Handle(TColStd_HArray1OfInteger)& thePnindices)
|
||||
{
|
||||
theNodes = theFace->Coordinates()->Points();
|
||||
theNormals = theFace->Normals();
|
||||
theTriangleStrips = theFace->TriangleStrips();
|
||||
theTriangleFans = theFace->TriangleFans();
|
||||
thePnIndNb = theFace->NbPnindex();
|
||||
theNormNb = theFace->NbNormals();
|
||||
theTriStripsNb = theFace->NbTriangleStrips();
|
||||
theTriFansNb = theFace->NbTriangleFans();
|
||||
thePnindices = new TColStd_HArray1OfInteger(1, thePnIndNb);
|
||||
for (Standard_Integer anIndx = 1; anIndx <= thePnIndNb; ++anIndx)
|
||||
{
|
||||
thePnindices->SetValue(anIndx, theFace->PnindexValue(anIndx));
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : CreatePolyTriangulation
|
||||
// Purpose : Create PolyTriangulation
|
||||
@ -392,14 +294,11 @@ namespace {
|
||||
Standard_Integer aTrianNum = 0;
|
||||
Handle(TColStd_HArray1OfInteger) aPnindices;
|
||||
|
||||
Handle(TColStd_HArray2OfInteger) aTriaStrips;
|
||||
Handle(TColStd_HArray2OfInteger) aTriaFans;
|
||||
Handle(TColStd_HArray1OfTransient) aTriaStrips;
|
||||
Handle(TColStd_HArray1OfTransient) aTriaFans;
|
||||
Standard_Integer aTrianStripsNum = 0;
|
||||
Standard_Integer aTrianFansNum = 0;
|
||||
|
||||
Handle(TColStd_HArray1OfTransient) aTriaStrips1;
|
||||
Handle(TColStd_HArray1OfTransient) aTriaFans1;
|
||||
|
||||
if (theTI->IsKind(STANDARD_TYPE(StepVisual_TriangulatedFace)))
|
||||
{
|
||||
Handle(StepVisual_TriangulatedFace) aTF = Handle(StepVisual_TriangulatedFace)::DownCast(theTI);
|
||||
@ -418,7 +317,7 @@ namespace {
|
||||
else if (theTI->IsKind(STANDARD_TYPE(StepVisual_ComplexTriangulatedSurfaceSet)))
|
||||
{
|
||||
Handle(StepVisual_ComplexTriangulatedSurfaceSet) aTSS = Handle(StepVisual_ComplexTriangulatedSurfaceSet)::DownCast(theTI);
|
||||
GetComplexFaceSetElements(aTSS, aNodes, aNormals, aTriaStrips1, aTriaFans1, aNumPnindex, aNormNum, aTrianStripsNum, aTrianFansNum, aPnindices);
|
||||
GetComplexFaceElements(aTSS, aNodes, aNormals, aTriaStrips, aTriaFans, aNumPnindex, aNormNum, aTrianStripsNum, aTrianFansNum, aPnindices);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -436,59 +335,28 @@ namespace {
|
||||
{
|
||||
Standard_Integer aNbTriaStrips = 0;
|
||||
Standard_Integer aNbTriaFans = 0;
|
||||
if (aTriaStrips1.IsNull() && aTriaFans1.IsNull())
|
||||
{
|
||||
for (Standard_Integer aTrianStripIndex = 1; aTrianStripIndex <= aTrianStripsNum; ++aTrianStripIndex)
|
||||
{
|
||||
for (Standard_Integer anUCIndex = 3; anUCIndex <= aTriaStrips->UpperCol(); anUCIndex += 2)
|
||||
{
|
||||
if (aTriaStrips->Value(aTrianStripIndex, anUCIndex) != aTriaStrips->Value(aTrianStripIndex, anUCIndex - 2) &&
|
||||
aTriaStrips->Value(aTrianStripIndex, anUCIndex) != aTriaStrips->Value(aTrianStripIndex, anUCIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
for (Standard_Integer anUCIndex = 4; anUCIndex <= aTriaStrips->UpperCol(); anUCIndex += 2)
|
||||
{
|
||||
if (aTriaStrips->Value(aTrianStripIndex, anUCIndex) != aTriaStrips->Value(aTrianStripIndex, anUCIndex - 2) &&
|
||||
aTriaStrips->Value(aTrianStripIndex, anUCIndex) != aTriaStrips->Value(aTrianStripIndex, anUCIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer aTrianFanIndex = 1; aTrianFanIndex <= aTrianFansNum; ++aTrianFanIndex)
|
||||
for (Standard_Integer aTrianStripIndex = 1; aTrianStripIndex <= aTrianStripsNum; ++aTrianStripIndex)
|
||||
{
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaStrips->Value(aTrianStripIndex));
|
||||
for (Standard_Integer anIndex = 3; anIndex <= aTriangleStrip->Length(); anIndex += 2)
|
||||
{
|
||||
Standard_Integer aFirst = aTriaStrips->Value(aTrianFanIndex, 1);
|
||||
for (Standard_Integer anUCIndex = 3; anUCIndex <= aTriaStrips->UpperCol(); ++anUCIndex)
|
||||
{
|
||||
if (aTriaStrips->Value(aTrianFanIndex, anUCIndex) != aFirst &&
|
||||
aTriaStrips->Value(aTrianFanIndex, anUCIndex - 1) != aFirst)
|
||||
++aNbTriaFans;
|
||||
}
|
||||
if (aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 2) &&
|
||||
aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
for (Standard_Integer anIndex = 4; anIndex <= aTriangleStrip->Length(); anIndex += 2)
|
||||
{
|
||||
if (aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 2) &&
|
||||
aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Standard_Integer aTrianStripIndex = 1; aTrianStripIndex <= aTrianStripsNum; ++aTrianStripIndex)
|
||||
{
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleStrip = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaStrips1->Value(aTrianStripIndex));
|
||||
for (Standard_Integer anIndex = 3; anIndex <= aTriangleStrip->Length(); anIndex += 2)
|
||||
{
|
||||
if (aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 2) &&
|
||||
aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
for (Standard_Integer anIndex = 4; anIndex <= aTriangleStrip->Length(); anIndex += 2)
|
||||
{
|
||||
if (aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 2) &&
|
||||
aTriangleStrip->Value(anIndex) != aTriangleStrip->Value(anIndex - 1))
|
||||
++aNbTriaStrips;
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer aTrianFanIndex = 1; aTrianFanIndex <= aTrianFansNum; ++aTrianFanIndex)
|
||||
{
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaFans1->Value(aTrianFansNum));
|
||||
aNbTriaFans += aTriangleFan->Length() - 2;
|
||||
}
|
||||
for (Standard_Integer aTrianFanIndex = 1; aTrianFanIndex <= aTrianFansNum; ++aTrianFanIndex)
|
||||
{
|
||||
Handle(TColStd_HArray1OfInteger) aTriangleFan = Handle(TColStd_HArray1OfInteger)::DownCast(aTriaFans->Value(aTrianFanIndex));
|
||||
aNbTriaFans += aTriangleFan->Length() - 2;
|
||||
}
|
||||
|
||||
aMesh = new Poly_Triangulation(aNumPnindex, aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
|
||||
@ -501,14 +369,7 @@ namespace {
|
||||
SetNormals(aMesh, aNormals, aNormNum, aNumPnindex);
|
||||
}
|
||||
|
||||
if (aTriaStrips1.IsNull() && aTriaFans1.IsNull())
|
||||
{
|
||||
SetTriangles(aMesh, aTriangles, aTrianStripsNum, aTriaStrips, aTrianFansNum, aTriaFans);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTriangles(aMesh, aTriangles, aTrianStripsNum, aTriaStrips1, aTrianFansNum, aTriaFans1);
|
||||
}
|
||||
SetTriangles(aMesh, aTriangles, aTrianStripsNum, aTriaStrips, aTrianFansNum, aTriaFans);
|
||||
|
||||
return aMesh;
|
||||
}
|
||||
@ -927,7 +788,7 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedSurface
|
||||
}
|
||||
else if (DeclareAndCast(StepVisual_ComplexTriangulatedSurfaceSet, aCompTriaSS, theTSS))
|
||||
{
|
||||
aMesh = createComplexMesh(aCompTriaSS, theLocalFactors);
|
||||
aMesh = createMesh(aCompTriaSS, theLocalFactors);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -950,7 +811,8 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedSurface
|
||||
|
||||
// ============================================================================
|
||||
// Method : createMesh
|
||||
// Purpose : creates a Poly_Triangulation from TriangulatedFace or TriangulatedSurfaceSet
|
||||
// Purpose : creates a Poly_Triangulation from simple/complex
|
||||
// TriangulatedFace or TriangulatedSurfaceSet
|
||||
// ============================================================================
|
||||
Handle(Poly_Triangulation)
|
||||
StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TessellatedItem)& theTI,
|
||||
@ -959,16 +821,6 @@ Handle(Poly_Triangulation)
|
||||
return CreatePolyTriangulation(theTI, theLocalFactors);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : createComplexMesh
|
||||
// Purpose : creates a Poly_Triangulation from ComplexTriangulatedFace or ComplexTriangulatedSurfaceSet
|
||||
// ============================================================================
|
||||
Handle(Poly_Triangulation)
|
||||
StepToTopoDS_TranslateFace::createComplexMesh(const Handle(StepVisual_TessellatedItem)& theTI,
|
||||
const StepData_Factors& theLocalFactors) const
|
||||
{
|
||||
return CreatePolyTriangulation(theTI, theLocalFactors);}
|
||||
|
||||
// ============================================================================
|
||||
// Method : Value
|
||||
// Purpose : Return the mapped Shape
|
||||
|
@ -86,8 +86,7 @@ private:
|
||||
|
||||
Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_TessellatedItem)& theTI,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
Handle(Poly_Triangulation) createComplexMesh(const Handle(StepVisual_TessellatedItem)& theTI,
|
||||
const StepData_Factors& theLocalFactors) const;
|
||||
|
||||
StepToTopoDS_TranslateFaceError myError;
|
||||
TopoDS_Shape myResult;
|
||||
|
||||
|
@ -39,8 +39,8 @@ void StepVisual_ComplexTriangulatedFace::Init (const Handle(TCollection_HAsciiSt
|
||||
const Standard_Boolean theHasTessellatedFace_GeometricLink,
|
||||
const StepVisual_FaceOrSurface& theTessellatedFace_GeometricLink,
|
||||
const Handle(TColStd_HArray1OfInteger)& thePnindex,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTriangleStrips,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTriangleFans)
|
||||
const Handle(TColStd_HArray1OfTransient)& theTriangleStrips,
|
||||
const Handle(TColStd_HArray1OfTransient)& theTriangleFans)
|
||||
{
|
||||
StepVisual_TessellatedFace::Init(theRepresentationItem_Name,
|
||||
theTessellatedFace_Coordinates,
|
||||
@ -107,7 +107,7 @@ Standard_Integer StepVisual_ComplexTriangulatedFace::PnindexValue(const Standard
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TColStd_HArray2OfInteger) StepVisual_ComplexTriangulatedFace::TriangleStrips () const
|
||||
Handle(TColStd_HArray1OfTransient) StepVisual_ComplexTriangulatedFace::TriangleStrips () const
|
||||
{
|
||||
return myTriangleStrips;
|
||||
}
|
||||
@ -117,7 +117,7 @@ Handle(TColStd_HArray2OfInteger) StepVisual_ComplexTriangulatedFace::TriangleStr
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void StepVisual_ComplexTriangulatedFace::SetTriangleStrips(const Handle(TColStd_HArray2OfInteger)& theTriangleStrips)
|
||||
void StepVisual_ComplexTriangulatedFace::SetTriangleStrips(const Handle(TColStd_HArray1OfTransient)& theTriangleStrips)
|
||||
{
|
||||
myTriangleStrips = theTriangleStrips;
|
||||
}
|
||||
@ -133,7 +133,7 @@ Standard_Integer StepVisual_ComplexTriangulatedFace::NbTriangleStrips() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return myTriangleStrips->ColLength();
|
||||
return myTriangleStrips->Length();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -141,7 +141,7 @@ Standard_Integer StepVisual_ComplexTriangulatedFace::NbTriangleStrips() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TColStd_HArray2OfInteger) StepVisual_ComplexTriangulatedFace::TriangleFans () const
|
||||
Handle(TColStd_HArray1OfTransient) StepVisual_ComplexTriangulatedFace::TriangleFans () const
|
||||
{
|
||||
return myTriangleFans;
|
||||
}
|
||||
@ -151,7 +151,7 @@ Handle(TColStd_HArray2OfInteger) StepVisual_ComplexTriangulatedFace::TriangleFan
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void StepVisual_ComplexTriangulatedFace::SetTriangleFans(const Handle(TColStd_HArray2OfInteger)& theTriangleFans)
|
||||
void StepVisual_ComplexTriangulatedFace::SetTriangleFans(const Handle(TColStd_HArray1OfTransient)& theTriangleFans)
|
||||
{
|
||||
myTriangleFans = theTriangleFans;
|
||||
}
|
||||
@ -167,5 +167,5 @@ Standard_Integer StepVisual_ComplexTriangulatedFace::NbTriangleFans() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return myTriangleFans->ColLength();
|
||||
return myTriangleFans->Length();
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <StepVisual_TessellatedFace.hxx>
|
||||
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray2OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfTransient.hxx>
|
||||
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_ComplexTriangulatedFace, StepVisual_TessellatedFace)
|
||||
|
||||
@ -43,8 +43,8 @@ public :
|
||||
const Standard_Boolean theHasTessellatedFace_GeometricLink,
|
||||
const StepVisual_FaceOrSurface& theTessellatedFace_GeometricLink,
|
||||
const Handle(TColStd_HArray1OfInteger)& thePnindex,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTriangleStrips,
|
||||
const Handle(TColStd_HArray2OfInteger)& theTriangleFans);
|
||||
const Handle(TColStd_HArray1OfTransient)& theTriangleStrips,
|
||||
const Handle(TColStd_HArray1OfTransient)& theTriangleFans);
|
||||
|
||||
//! Returns field Pnindex
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfInteger) Pnindex() const;
|
||||
@ -59,19 +59,19 @@ public :
|
||||
Standard_EXPORT Standard_Integer PnindexValue(const Standard_Integer theNum) const;
|
||||
|
||||
//! Returns field TriangleStrips
|
||||
Standard_EXPORT Handle(TColStd_HArray2OfInteger) TriangleStrips() const;
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfTransient) TriangleStrips() const;
|
||||
|
||||
//! Sets field TriangleStrips
|
||||
Standard_EXPORT void SetTriangleStrips (const Handle(TColStd_HArray2OfInteger)& theTriangleStrips);
|
||||
Standard_EXPORT void SetTriangleStrips (const Handle(TColStd_HArray1OfTransient)& theTriangleStrips);
|
||||
|
||||
//! Returns number of TriangleStrips
|
||||
Standard_EXPORT Standard_Integer NbTriangleStrips() const;
|
||||
|
||||
//! Returns field TriangleFans
|
||||
Standard_EXPORT Handle(TColStd_HArray2OfInteger) TriangleFans() const;
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfTransient) TriangleFans() const;
|
||||
|
||||
//! Sets field TriangleFans
|
||||
Standard_EXPORT void SetTriangleFans (const Handle(TColStd_HArray2OfInteger)& theTriangleFans);
|
||||
Standard_EXPORT void SetTriangleFans (const Handle(TColStd_HArray1OfTransient)& theTriangleFans);
|
||||
|
||||
//! Returns number of TriangleFans
|
||||
Standard_EXPORT Standard_Integer NbTriangleFans() const;
|
||||
@ -81,8 +81,8 @@ public :
|
||||
private:
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) myPnindex;
|
||||
Handle(TColStd_HArray2OfInteger) myTriangleStrips;
|
||||
Handle(TColStd_HArray2OfInteger) myTriangleFans;
|
||||
Handle(TColStd_HArray1OfTransient) myTriangleStrips;
|
||||
Handle(TColStd_HArray1OfTransient) myTriangleFans;
|
||||
|
||||
};
|
||||
|
||||
|
@ -9,4 +9,4 @@ XGetOneShape S D
|
||||
|
||||
set nb_faces 273
|
||||
set nb_nodes 3788
|
||||
set nb_triangles 2893
|
||||
set nb_triangles 3377
|
||||
|
Loading…
x
Reference in New Issue
Block a user