// transformation will be stored at scene nodes
aMergedFaces.Clear(false);
-
- Standard_Integer aBinDataSize = myBinDataMap.Size();
{
RWMesh_FaceIterator aFaceIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
dispatchShapes(aDocNode, aPSentryBin, aMergedFaces, aFaceIter);
}
- if (aBinDataSize == myBinDataMap.Size())
{
RWMesh_EdgeIterator anEdgeIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
dispatchShapes(aDocNode, aPSentryBin, aMergedFaces, anEdgeIter);
}
- if (aBinDataSize == myBinDataMap.Size())
{
RWMesh_VertexIterator aVertexIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
dispatchShapes(aDocNode, aPSentryBin, aMergedFaces, aVertexIter);
//=================================================================================================
void RWGltf_CafWriter::writeMaterial(RWMesh_ShapeIterator& theShapeIter,
- Standard_Boolean& theIsStarted,
- Standard_Integer& theAddedMaterialsNb)
+ Standard_Boolean& theIsStarted)
{
for (; theShapeIter.More(); theShapeIter.Next())
{
myMaterialMap->AddMaterial(myWriter.get(), theShapeIter.Style(), theIsStarted);
- theAddedMaterialsNb++;
}
}
for (RWGltf_GltfSceneNodeMap::Iterator aSceneNodeIter(theSceneNodeMap); aSceneNodeIter.More();
aSceneNodeIter.Next())
{
- const XCAFPrs_DocumentNode& aDocNode = aSceneNodeIter.Value();
- Standard_Integer anAddedMaterialsNb = 0;
+ const XCAFPrs_DocumentNode& aDocNode = aSceneNodeIter.Value();
{
RWMesh_FaceIterator aFaceIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeMaterial(aFaceIter, anIsStarted, anAddedMaterialsNb);
+ writeMaterial(aFaceIter, anIsStarted);
}
- if (anAddedMaterialsNb == 0)
{
RWMesh_EdgeIterator anEdgeIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeMaterial(anEdgeIter, anIsStarted, anAddedMaterialsNb);
+ writeMaterial(anEdgeIter, anIsStarted);
}
- if (anAddedMaterialsNb == 0)
{
RWMesh_VertexIterator VertexIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeMaterial(VertexIter, anIsStarted, anAddedMaterialsNb);
+ writeMaterial(VertexIter, anIsStarted);
}
}
if (anIsStarted)
//=================================================================================================
void RWGltf_CafWriter::writeShapes(RWMesh_ShapeIterator& theShapeIter,
- Standard_Integer& theNbFacesInNode,
Standard_Integer& theDracoBufInd,
Standard_Boolean& theToStartPrims,
const TCollection_AsciiString& theNodeName,
NCollection_Map<Handle(RWGltf_GltfFaceList)>& theWrittenShapes,
NCollection_IndexedDataMap<int, int>& theDracoBufIndMap)
{
- for (; theShapeIter.More(); theShapeIter.Next(), ++theNbFacesInNode)
+ for (; theShapeIter.More(); theShapeIter.Next())
{
if (toSkipShape(theShapeIter))
{
const TCollection_AsciiString aNodeName =
formatName(myMeshNameFormat, aDocNode.Label, aDocNode.RefLabel);
- bool toStartPrims = true;
- Standard_Integer aNbShapes = 0;
+ bool toStartPrims = true;
aWrittenShapes.Clear(false);
if (myToMergeFaces)
{
{
{
RWMesh_FaceIterator anIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeShapes(anIter,
- aNbShapes,
- aDracoBufInd,
- toStartPrims,
- aNodeName,
- aWrittenShapes,
- aDracoBufMap);
+ writeShapes(anIter, aDracoBufInd, toStartPrims, aNodeName, aWrittenShapes, aDracoBufMap);
}
- if (aNbShapes == 0)
{
RWMesh_EdgeIterator anIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeShapes(anIter,
- aNbShapes,
- aDracoBufInd,
- toStartPrims,
- aNodeName,
- aWrittenShapes,
- aDracoBufMap);
+ writeShapes(anIter, aDracoBufInd, toStartPrims, aNodeName, aWrittenShapes, aDracoBufMap);
}
- if (aNbShapes == 0)
{
RWMesh_VertexIterator anIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
- writeShapes(anIter,
- aNbShapes,
- aDracoBufInd,
- toStartPrims,
- aNodeName,
- aWrittenShapes,
- aDracoBufMap);
+ writeShapes(anIter, aDracoBufInd, toStartPrims, aNodeName, aWrittenShapes, aDracoBufMap);
}
}
//! Write RWGltf_GltfRootElement_Materials section.
//! @param[in] theShapeIter Shape iterator to traverse shapes
//! @param[out] theIsStarted Flag indicating that writing material has been started
- //! @param[out] theAddedMaterialsNb Number of added materials
Standard_EXPORT virtual void writeMaterial(RWMesh_ShapeIterator& theShapeIter,
- Standard_Boolean& theIsStarted,
- Standard_Integer& theAddedMaterialsNb);
+ Standard_Boolean& theIsStarted);
//! Write RWGltf_GltfRootElement_Meshes section.
//! @param[in] theSceneNodeMap ordered map of scene nodes
//! Write shapes to RWGltf_GltfRootElement_Meshes section
//! @param[in] theShapeIter Shape iterator to traverse shapes
- //! @param[in,out] theNbFacesInNode Number of faces in the current node
//! @param[in,out] theDracoBufInd Draco buffer index
//! @param[in,out] theToStartPrims Flag to indicate if primitives should be started
//! @param[in] theNodeName Name of the current node
//! @param[in,out] theDracoBufIndMap Map to store Draco buffer indices
Standard_EXPORT virtual void writeShapes(
RWMesh_ShapeIterator& theShapeIter,
- Standard_Integer& theNbFacesInNode,
Standard_Integer& theDracoBufInd,
Standard_Boolean& theToStartPrims,
const TCollection_AsciiString& theNodeName,
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theLabel, theLocation, TopAbs_EDGE, theToMapColors, theStyle)
+ : RWMesh_ShapeIterator(theLabel,
+ theLocation,
+ TopAbs_EDGE,
+ TopAbs_FACE,
+ theToMapColors,
+ theStyle)
{
Next();
}
RWMesh_EdgeIterator::RWMesh_EdgeIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theShape, TopAbs_EDGE, theStyle)
+ : RWMesh_ShapeIterator(theShape, TopAbs_EDGE, TopAbs_FACE, theStyle)
{
Next();
}
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theLabel, theLocation, TopAbs_FACE, theToMapColors, theStyle),
+ : RWMesh_ShapeIterator(theLabel,
+ theLocation,
+ TopAbs_FACE,
+ TopAbs_SHAPE,
+ theToMapColors,
+ theStyle),
mySLTool(1, 1e-12),
myHasNormals(false),
myIsMirrored(false)
RWMesh_FaceIterator::RWMesh_FaceIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theShape, TopAbs_FACE, theStyle),
+ : RWMesh_ShapeIterator(theShape, TopAbs_FACE, TopAbs_SHAPE, theStyle),
mySLTool(1, 1e-12),
myHasNormals(false),
myIsMirrored(false)
RWMesh_ShapeIterator::RWMesh_ShapeIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
- const TopAbs_ShapeEnum theShapeType,
+ const TopAbs_ShapeEnum theShapeTypeFind,
+ const TopAbs_ShapeEnum theShapeTypeAvoid,
const Standard_Boolean theToMapColors,
const XCAFPrs_Style& theStyle)
: myDefStyle(theStyle),
myToMapColors(theToMapColors),
- myShapeType(theShapeType),
+ myShapeType(theShapeTypeFind),
myHasColor(false)
{
TopoDS_Shape aShape;
}
aShape.Location(theLocation, false);
- myIter.Init(aShape, myShapeType);
+ myIter.Init(aShape, myShapeType, theShapeTypeAvoid);
if (theToMapColors)
{
//=================================================================================================
RWMesh_ShapeIterator::RWMesh_ShapeIterator(const TopoDS_Shape& theShape,
- const TopAbs_ShapeEnum theShapeType,
+ const TopAbs_ShapeEnum theShapeTypeFind,
+ const TopAbs_ShapeEnum theShapeTypeAvoid,
const XCAFPrs_Style& theStyle)
: myDefStyle(theStyle),
myToMapColors(true),
- myShapeType(theShapeType),
+ myShapeType(theShapeTypeFind),
myHasColor(false)
{
if (theShape.IsNull())
{
return;
}
- myIter.Init(theShape, myShapeType);
+ myIter.Init(theShape, myShapeType, theShapeTypeAvoid);
}
//=================================================================================================
myHasColor = true;
myColor = myStyle.GetColorSurfRGBA();
}
+ else if (myStyle.IsSetColorCurv())
+ {
+ myHasColor = true;
+ myColor = Quantity_ColorRGBA(myStyle.GetColorCurv());
+ }
}
\ No newline at end of file
//! Main constructor.
RWMesh_ShapeIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
- const TopAbs_ShapeEnum theShapeType,
+ const TopAbs_ShapeEnum theShapeTypeFind,
+ const TopAbs_ShapeEnum theShapeTypeAvoid,
const Standard_Boolean theToMapColors = false,
const XCAFPrs_Style& theStyle = XCAFPrs_Style());
//! Auxiliary constructor.
RWMesh_ShapeIterator(const TopoDS_Shape& theShape,
- const TopAbs_ShapeEnum theShapeType,
+ const TopAbs_ShapeEnum theShapeTypeFind,
+ const TopAbs_ShapeEnum theShapeTypeAvoid,
const XCAFPrs_Style& theStyle = XCAFPrs_Style());
//! Dispatch shape styles.
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theLabel, theLocation, TopAbs_VERTEX, theToMapColors, theStyle)
+ : RWMesh_ShapeIterator(theLabel,
+ theLocation,
+ TopAbs_VERTEX,
+ TopAbs_EDGE,
+ theToMapColors,
+ theStyle)
{
Next();
}
RWMesh_VertexIterator::RWMesh_VertexIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
- : RWMesh_ShapeIterator(theShape, TopAbs_VERTEX, theStyle)
+ : RWMesh_ShapeIterator(theShape, TopAbs_VERTEX, TopAbs_EDGE, theStyle)
{
Next();
}
ReadGltf D "$aTmpGltf"
XGetOneShape s D
-checknbshapes s -face 6 -vertex 8 -compound 11
+checknbshapes s -face 6 -compound 2
set THE_REF_DUMP {
ASSEMBLY COMPOUND 0:1:1:1 "empty_tmp.glb"
INSTANCE COMPOUND 0:1:1:1:1 (refers to 0:1:1:2) "Compound"
- INSTANCE COMPOUND 0:1:1:1:2 (refers to 0:1:1:19) "Compound"
-ASSEMBLY COMPOUND 0:1:1:2 "Compound"
- INSTANCE COMPOUND 0:1:1:2:1 (refers to 0:1:1:3) "Compound"
- INSTANCE COMPOUND 0:1:1:2:2 (refers to 0:1:1:5) "Compound"
- INSTANCE COMPOUND 0:1:1:2:3 (refers to 0:1:1:7) "Compound"
- INSTANCE COMPOUND 0:1:1:2:4 (refers to 0:1:1:9) "Compound"
- INSTANCE COMPOUND 0:1:1:2:5 (refers to 0:1:1:11) "Compound"
- INSTANCE COMPOUND 0:1:1:2:6 (refers to 0:1:1:13) "Compound"
- INSTANCE COMPOUND 0:1:1:2:7 (refers to 0:1:1:15) "Compound"
- INSTANCE COMPOUND 0:1:1:2:8 (refers to 0:1:1:17) "Compound"
-ASSEMBLY COMPOUND 0:1:1:3 "Compound"
- INSTANCE VERTEX 0:1:1:3:1 (refers to 0:1:1:4) "Vertex"
-PART VERTEX 0:1:1:4 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:5 "Compound"
- INSTANCE VERTEX 0:1:1:5:1 (refers to 0:1:1:6) "Vertex"
-PART VERTEX 0:1:1:6 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:7 "Compound"
- INSTANCE VERTEX 0:1:1:7:1 (refers to 0:1:1:8) "Vertex"
-PART VERTEX 0:1:1:8 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:9 "Compound"
- INSTANCE VERTEX 0:1:1:9:1 (refers to 0:1:1:10) "Vertex"
-PART VERTEX 0:1:1:10 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:11 "Compound"
- INSTANCE VERTEX 0:1:1:11:1 (refers to 0:1:1:12) "Vertex"
-PART VERTEX 0:1:1:12 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:13 "Compound"
- INSTANCE VERTEX 0:1:1:13:1 (refers to 0:1:1:14) "Vertex"
-PART VERTEX 0:1:1:14 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:15 "Compound"
- INSTANCE VERTEX 0:1:1:15:1 (refers to 0:1:1:16) "Vertex"
-PART VERTEX 0:1:1:16 "Vertex"
-ASSEMBLY COMPOUND 0:1:1:17 "Compound"
- INSTANCE VERTEX 0:1:1:17:1 (refers to 0:1:1:18) "Vertex"
-PART VERTEX 0:1:1:18 "Vertex"
-PART COMPOUND 0:1:1:19 "Compound"
+PART COMPOUND 0:1:1:2 "Compound"
Free Shapes: 1
ASSEMBLY COMPOUND 0:1:1:1 "empty_tmp.glb"
# !!!! This file is generated automatically, do not edit manually! See end script
set filename bug28389_CONFIDENTIAL_SHEET_METAL_F3D.stp
-set ref_size 103329
+set ref_size 121022
set check_metadata 1
set ref_metadata {Property for [0:1:1:1]:
yCenterOfGravity : 0.1148447698
# !!!! This file is generated automatically, do not edit manually! See end script
set filename bug28444_nist_ftc_06_asme1_ct5240_rd.stp
-set ref_size 118300
+set ref_size 126516
set check_metadata 1
set ref_metadata {Property for [0:1:1:1]:
yCenterOfGravity : 0.0289950044
# !!!! This file is generated automatically, do not edit manually! See end script
set filename bug29525_rev_part_neu_01.prt_converted_from_datakit.stp
-set ref_size 90657
+set ref_size 90717
set check_metadata 0
# !!!! This file is generated automatically, do not edit manually! See end script
set filename bug29633_nist_ctc_05_asme1_ap242-1.stp
-set ref_size 70034
+set ref_size 73100
set check_metadata 1
set ref_metadata {Property for [0:1:1:1]:
FILESIZE : 1495040
# !!!! This file is generated automatically, do not edit manually! See end script
set filename sp7_04-do-242.stp
-set ref_size 246373
+set ref_size 260039
set check_metadata 1
set ref_metadata {Property for [0:1:1:1]:
PRO_MP_ALT_COGX : - >