diff --git a/src/OpenGl/OpenGl_CappingRenderer.cxx b/src/OpenGl/OpenGl_CappingRenderer.cxx index d5e0e65075..9009e9989c 100644 --- a/src/OpenGl/OpenGl_CappingRenderer.cxx +++ b/src/OpenGl/OpenGl_CappingRenderer.cxx @@ -298,7 +298,7 @@ void OpenGl_CappingRenderer::renderOne (const Handle(OpenGl_Workspace)& theWo aViewScale = static_cast (aViewDim.Y() / aContext->Viewport()[3]); } - aHatchScale = 1.0f / (aViewScale * anAspectHatching->TextureRes (aContext)->SizeY()); + aHatchScale = 1.0f / (aViewScale * anAspectHatching->TextureSet (aContext)->First()->SizeY()); } } @@ -355,7 +355,7 @@ void OpenGl_CappingRenderer::renderSection (const Handle(OpenGl_Workspace)& theW if (theHatchScale != 1.0 || theHatchRotate != 0.0) { - const Handle(Graphic3d_TextureParams)& aTexParams = theHatchAspect->TextureParams(); + const Handle(Graphic3d_TextureParams)& aTexParams = theHatchAspect->TextureSet(aContext)->First()->Sampler()->Parameters(); aPrevScale = aTexParams->Scale(); aPrevRotate = aTexParams->Rotation(); @@ -381,7 +381,7 @@ void OpenGl_CappingRenderer::renderSection (const Handle(OpenGl_Workspace)& theW if (theHatchScale != 1.0 || theHatchRotate != 0.0) { - const Handle(Graphic3d_TextureParams)& aTexParams = theHatchAspect->TextureParams(); + const Handle(Graphic3d_TextureParams)& aTexParams = theHatchAspect->TextureSet(aContext)->First()->Sampler()->Parameters(); aTexParams->SetScale (aPrevScale); aTexParams->SetRotation (aPrevRotate); diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index f2d185faff..a318b8ad2f 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -1243,8 +1243,8 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramFboBlit() } myContext->BindProgram (myBlitProgram); - myBlitProgram->SetSampler (myContext, "uColorSampler", 0); - myBlitProgram->SetSampler (myContext, "uDepthSampler", 1); + myBlitProgram->SetSampler(myContext, "uColorSampler", Graphic3d_TextureUnit_0); + myBlitProgram->SetSampler(myContext, "uDepthSampler", Graphic3d_TextureUnit_1); myContext->BindProgram (NULL); return Standard_True; } @@ -1331,8 +1331,8 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramOitCompositing (const St } myContext->BindProgram (aProgram); - aProgram->SetSampler (myContext, "uAccumTexture", 0); - aProgram->SetSampler (myContext, "uWeightTexture", 1); + aProgram->SetSampler(myContext, "uAccumTexture", Graphic3d_TextureUnit_0); + aProgram->SetSampler(myContext, "uWeightTexture", Graphic3d_TextureUnit_1); myContext->BindProgram (Handle(OpenGl_ShaderProgram)()); return Standard_True; } @@ -2203,8 +2203,8 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramStereo (Handle(OpenGl_Sh } myContext->BindProgram (theProgram); - theProgram->SetSampler (myContext, "uLeftSampler", 0); - theProgram->SetSampler (myContext, "uRightSampler", 1); + theProgram->SetSampler(myContext, "uLeftSampler", Graphic3d_TextureUnit_0); + theProgram->SetSampler(myContext, "uRightSampler", Graphic3d_TextureUnit_1); myContext->BindProgram (NULL); return Standard_True; } diff --git a/src/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/VrmlData/VrmlData_IndexedFaceSet.cxx index 94a5d687ab..f3871a3470 100644 --- a/src/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -39,8 +39,8 @@ #include #include #include -#include -#include +//#include +//#include #include #include #include @@ -56,240 +56,240 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlData_IndexedFaceSet,VrmlData_Faceted) #pragma warning (disable:4996) #endif -// Auxiliary tools -namespace -{ - // Tool to get triangles from triangulation taking into account face - // orientation and location - class TriangleAccessor - { - public: - TriangleAccessor (const TopoDS_Face& aFace) - { - TopLoc_Location aLoc; - myPoly = BRep_Tool::Triangulation (aFace, aLoc); - myTrsf = aLoc.Transformation(); - myNbTriangles = (myPoly.IsNull() ? 0 : myPoly->Triangles().Length()); - myInvert = (aFace.Orientation() == TopAbs_REVERSED); - if (myTrsf.IsNegative()) - myInvert = ! myInvert; - } - - int NbTriangles () const { return myNbTriangles; } - - // get i-th triangle and outward normal - void GetTriangle (int iTri, gp_Vec &theNormal, gp_Pnt &thePnt1, gp_Pnt &thePnt2, gp_Pnt &thePnt3) - { - // get positions of nodes - int iNode1, iNode2, iNode3; - myPoly->Triangles()(iTri).Get (iNode1, iNode2, iNode3); - thePnt1 = myPoly->Nodes()(iNode1); - thePnt2 = myPoly->Nodes()(myInvert ? iNode3 : iNode2); - thePnt3 = myPoly->Nodes()(myInvert ? iNode2 : iNode3); - - // apply transormation if not identity - if (myTrsf.Form() != gp_Identity) - { - thePnt1.Transform (myTrsf); - thePnt2.Transform (myTrsf); - thePnt3.Transform (myTrsf); - } - - // calculate normal - theNormal = (thePnt2.XYZ() - thePnt1.XYZ()) ^ (thePnt3.XYZ() - thePnt1.XYZ()); - Standard_Real aNorm = theNormal.Magnitude(); - if (aNorm > gp::Resolution()) - theNormal /= aNorm; - } - - private: - Handle(Poly_Triangulation) myPoly; - gp_Trsf myTrsf; - int myNbTriangles; - bool myInvert; - }; - - // convert to float and, on big-endian platform, to little-endian representation - inline float convertFloat (Standard_Real aValue) - { -#ifdef OCCT_BINARY_FILE_DO_INVERSE - return OSD_BinaryFile::InverseShortReal ((float)aValue); -#else - return (float)aValue; -#endif - } - - // A static method adding nodes to a mesh and keeping coincident (sharing) nodes. - static Standard_Integer AddVertex(Handle(StlMesh_Mesh)& mesh, - BRepBuilderAPI_CellFilter& filter, - BRepBuilderAPI_VertexInspector& inspector, - const gp_XYZ& p) - { - Standard_Integer index; - inspector.SetCurrent(p); - gp_XYZ minp = inspector.Shift(p, -Precision::Confusion()); - gp_XYZ maxp = inspector.Shift(p, +Precision::Confusion()); - filter.Inspect(minp, maxp, inspector); - const TColStd_ListOfInteger& indices = inspector.ResInd(); - if (indices.IsEmpty() == Standard_False) - { - index = indices.First(); // it should be only one - inspector.ClearResList(); - } - else - { - index = mesh->AddVertex(p.X(), p.Y(), p.Z()); - filter.Add(index, p); - inspector.Add(p); - } - return index; - } - - void createFromMesh(Handle(TopoDS_TShape)& theShapeWithMesh) - { - TopoDS_Shape aShape; - //aShape.Orientation(TopAbs_FORWARD); - - aShape.TShape(theShapeWithMesh); - if (aShape.IsNull()) - return; - - // Write to STL and then read again to get BRep model (vrml fills only triangulation) - //StlAPI::Write(aShape, "D:/Temp/tempfile"); - //StlAPI::Read(aShape, "D:/Temp/tempfile"); - - gp_XYZ p1, p2, p3; - TopoDS_Vertex Vertex1, Vertex2, Vertex3; - TopoDS_Face AktFace; - TopoDS_Wire AktWire; - BRepBuilderAPI_Sewing aSewingTool; - Standard_Real x1, y1, z1; - Standard_Real x2, y2, z2; - Standard_Real x3, y3, z3; - Standard_Integer i1,i2,i3; - - aSewingTool.Init(1.0e-06,Standard_True); - - TopoDS_Compound aComp; - BRep_Builder BuildTool; - BuildTool.MakeCompound( aComp ); - - Handle(StlMesh_Mesh) aSTLMesh = new StlMesh_Mesh(); - aSTLMesh->AddDomain(); - - // Filter unique vertices to share the nodes of the mesh. - BRepBuilderAPI_CellFilter uniqueVertices(Precision::Confusion()); - BRepBuilderAPI_VertexInspector inspector(Precision::Confusion()); - - // Read mesh - for (TopExp_Explorer exp (aShape, TopAbs_FACE); exp.More(); exp.Next()) - { - TriangleAccessor aTool (TopoDS::Face (exp.Current())); - for (int iTri = 1; iTri <= aTool.NbTriangles(); iTri++) - { - gp_Vec aNorm; - gp_Pnt aPnt1, aPnt2, aPnt3; - aTool.GetTriangle(iTri, aNorm, aPnt1, aPnt2, aPnt3); - - i1 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt1.XYZ()); - i2 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt2.XYZ()); - i3 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt3.XYZ()); - aSTLMesh->AddTriangle(i1, i2, i3, aNorm.X(), aNorm.Y(), aNorm.Z()); - } - } - - StlMesh_MeshExplorer aMExp (aSTLMesh); - Standard_Integer NumberDomains = aSTLMesh->NbDomains(); - Standard_Integer iND; - for (iND=1;iND<=NumberDomains;iND++) - { - for (aMExp.InitTriangle (iND); aMExp.MoreTriangle (); aMExp.NextTriangle ()) - { - aMExp.TriangleVertices (x1,y1,z1,x2,y2,z2,x3,y3,z3); - p1.SetCoord(x1,y1,z1); - p2.SetCoord(x2,y2,z2); - p3.SetCoord(x3,y3,z3); - - if ((!(p1.IsEqual(p2,0.0))) && (!(p1.IsEqual(p3,0.0)))) - { - Vertex1 = BRepBuilderAPI_MakeVertex(p1); - Vertex2 = BRepBuilderAPI_MakeVertex(p2); - Vertex3 = BRepBuilderAPI_MakeVertex(p3); - - AktWire = BRepBuilderAPI_MakePolygon( Vertex1, Vertex2, Vertex3, Standard_True); - - if( !AktWire.IsNull()) - { - AktFace = BRepBuilderAPI_MakeFace( AktWire); - if(!AktFace.IsNull()) - BuildTool.Add( aComp, AktFace ); - } - } - } - } - aSTLMesh->Clear(); - - aSewingTool.Init(); - aSewingTool.Load( aComp ); - aSewingTool.Perform(); - aShape = aSewingTool.SewedShape(); - if ( aShape.IsNull() ) - aShape = aComp; - - ShapeUpgrade_UnifySameDomain anUSD(aShape); - anUSD.SetLinearTolerance(1e-5); - anUSD.Build(); - aShape = anUSD.Shape(); - - if (aShape.ShapeType() == TopAbs_SHELL && TopoDS::Shell(aShape).Closed()) - { - TopoDS_Solid aSolid; - TopoDS_Shell aShell = TopoDS::Shell (aShape); - if (!aShell.Free ()) { - aShell.Free(Standard_True); - } - BRep_Builder aBuilder; - aBuilder.MakeSolid (aSolid); - aBuilder.Add (aSolid, aShell); - - Standard_Boolean isOk = Standard_True; - try { - OCC_CATCH_SIGNALS - BRepClass3d_SolidClassifier bsc3d (aSolid); - Standard_Real t = Precision::Confusion(); - bsc3d.PerformInfinitePoint(t); - - if (bsc3d.State() == TopAbs_IN) { - TopoDS_Solid aSolid2; - aBuilder.MakeSolid (aSolid2); - aShell.Reverse(); - aBuilder.Add (aSolid2, aShell); - aSolid = aSolid2; - } - } - catch (Standard_Failure) { isOk = Standard_False; } - if (isOk) aShape = aSolid; - } - - // Trying to apply "Combine to Cylinder" - - //ShapeUpgrade_CombineToCylinder cmb2Cyl; - //Standard_Boolean isOk = Standard_True; - //try { - // OCC_CATCH_SIGNALS - // cmb2Cyl.SetShape(aShape); - // cmb2Cyl.SetAngularTolerance(20); - // cmb2Cyl.SetLinearTolerance(3); - // cmb2Cyl.Build(); - //} - //catch (Standard_Failure) { isOk = Standard_False; } - //if (isOk && cmb2Cyl.IsDone()) - // aShape = cmb2Cyl.Shape(); - - theShapeWithMesh = aShape.TShape(); - } -} - +//// Auxiliary tools +//namespace +//{ +// // Tool to get triangles from triangulation taking into account face +// // orientation and location +// class TriangleAccessor +// { +// public: +// TriangleAccessor (const TopoDS_Face& aFace) +// { +// TopLoc_Location aLoc; +// myPoly = BRep_Tool::Triangulation (aFace, aLoc); +// myTrsf = aLoc.Transformation(); +// myNbTriangles = (myPoly.IsNull() ? 0 : myPoly->Triangles().Length()); +// myInvert = (aFace.Orientation() == TopAbs_REVERSED); +// if (myTrsf.IsNegative()) +// myInvert = ! myInvert; +// } +// +// int NbTriangles () const { return myNbTriangles; } +// +// // get i-th triangle and outward normal +// void GetTriangle (int iTri, gp_Vec &theNormal, gp_Pnt &thePnt1, gp_Pnt &thePnt2, gp_Pnt &thePnt3) +// { +// // get positions of nodes +// int iNode1, iNode2, iNode3; +// myPoly->Triangles()(iTri).Get (iNode1, iNode2, iNode3); +// thePnt1 = myPoly->Nodes()(iNode1); +// thePnt2 = myPoly->Nodes()(myInvert ? iNode3 : iNode2); +// thePnt3 = myPoly->Nodes()(myInvert ? iNode2 : iNode3); +// +// // apply transormation if not identity +// if (myTrsf.Form() != gp_Identity) +// { +// thePnt1.Transform (myTrsf); +// thePnt2.Transform (myTrsf); +// thePnt3.Transform (myTrsf); +// } +// +// // calculate normal +// theNormal = (thePnt2.XYZ() - thePnt1.XYZ()) ^ (thePnt3.XYZ() - thePnt1.XYZ()); +// Standard_Real aNorm = theNormal.Magnitude(); +// if (aNorm > gp::Resolution()) +// theNormal /= aNorm; +// } +// +// private: +// Handle(Poly_Triangulation) myPoly; +// gp_Trsf myTrsf; +// int myNbTriangles; +// bool myInvert; +// }; +// +// // convert to float and, on big-endian platform, to little-endian representation +// inline float convertFloat (Standard_Real aValue) +// { +//#ifdef OCCT_BINARY_FILE_DO_INVERSE +// return OSD_BinaryFile::InverseShortReal ((float)aValue); +//#else +// return (float)aValue; +//#endif +// } +// +// // A static method adding nodes to a mesh and keeping coincident (sharing) nodes. +// static Standard_Integer AddVertex(Handle(StlMesh_Mesh)& mesh, +// BRepBuilderAPI_CellFilter& filter, +// BRepBuilderAPI_VertexInspector& inspector, +// const gp_XYZ& p) +// { +// Standard_Integer index; +// inspector.SetCurrent(p); +// gp_XYZ minp = inspector.Shift(p, -Precision::Confusion()); +// gp_XYZ maxp = inspector.Shift(p, +Precision::Confusion()); +// filter.Inspect(minp, maxp, inspector); +// else +// const TColStd_ListOfInteger& indices = inspector.ResInd(); +// if (indices.IsEmpty() == Standard_False) +// { +// index = indices.First(); // it should be only one +// inspector.ClearResList(); +// } +// { +// index = mesh->AddVertex(p.X(), p.Y(), p.Z()); +// filter.Add(index, p); +// inspector.Add(p); +// } +// return index; +// } +// +// void createFromMesh(Handle(TopoDS_TShape)& theShapeWithMesh) +// { +// TopoDS_Shape aShape; +// //aShape.Orientation(TopAbs_FORWARD); +// +// aShape.TShape(theShapeWithMesh); +// if (aShape.IsNull()) +// return; +// +// // Write to STL and then read again to get BRep model (vrml fills only triangulation) +// //StlAPI::Write(aShape, "D:/Temp/tempfile"); +// //StlAPI::Read(aShape, "D:/Temp/tempfile"); +// +// gp_XYZ p1, p2, p3; +// TopoDS_Vertex Vertex1, Vertex2, Vertex3; +// TopoDS_Face AktFace; +// TopoDS_Wire AktWire; +// BRepBuilderAPI_Sewing aSewingTool; +// Standard_Real x1, y1, z1; +// Standard_Real x2, y2, z2; +// Standard_Real x3, y3, z3; +// Standard_Integer i1,i2,i3; +// +// aSewingTool.Init(1.0e-06,Standard_True); +// +// TopoDS_Compound aComp; +// BRep_Builder BuildTool; +// BuildTool.MakeCompound( aComp ); +// +// Handle(StlMesh_Mesh) aSTLMesh = new StlMesh_Mesh(); +// aSTLMesh->AddDomain(); +// +// // Filter unique vertices to share the nodes of the mesh. +// BRepBuilderAPI_CellFilter uniqueVertices(Precision::Confusion()); +// BRepBuilderAPI_VertexInspector inspector(Precision::Confusion()); +// +// // Read mesh +// for (TopExp_Explorer exp (aShape, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TriangleAccessor aTool (TopoDS::Face (exp.Current())); +// for (int iTri = 1; iTri <= aTool.NbTriangles(); iTri++) +// { +// gp_Vec aNorm; +// gp_Pnt aPnt1, aPnt2, aPnt3; +// aTool.GetTriangle(iTri, aNorm, aPnt1, aPnt2, aPnt3); +// +// i1 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt1.XYZ()); +// i2 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt2.XYZ()); +// i3 = AddVertex(aSTLMesh, uniqueVertices, inspector, aPnt3.XYZ()); +// aSTLMesh->AddTriangle(i1, i2, i3, aNorm.X(), aNorm.Y(), aNorm.Z()); +// } +// } +// +// StlMesh_MeshExplorer aMExp (aSTLMesh); +// Standard_Integer NumberDomains = aSTLMesh->NbDomains(); +// Standard_Integer iND; +// for (iND=1;iND<=NumberDomains;iND++) +// { +// for (aMExp.InitTriangle (iND); aMExp.MoreTriangle (); aMExp.NextTriangle ()) +// { +// aMExp.TriangleVertices (x1,y1,z1,x2,y2,z2,x3,y3,z3); +// p1.SetCoord(x1,y1,z1); +// p2.SetCoord(x2,y2,z2); +// p3.SetCoord(x3,y3,z3); +// +// if ((!(p1.IsEqual(p2,0.0))) && (!(p1.IsEqual(p3,0.0)))) +// { +// Vertex1 = BRepBuilderAPI_MakeVertex(p1); +// Vertex2 = BRepBuilderAPI_MakeVertex(p2); +// Vertex3 = BRepBuilderAPI_MakeVertex(p3); +// +// AktWire = BRepBuilderAPI_MakePolygon( Vertex1, Vertex2, Vertex3, Standard_True); +// +// if( !AktWire.IsNull()) +// { +// AktFace = BRepBuilderAPI_MakeFace( AktWire); +// if(!AktFace.IsNull()) +// BuildTool.Add( aComp, AktFace ); +// } +// } +// } +// } +// aSTLMesh->Clear(); +// +// aSewingTool.Init(); +// aSewingTool.Load( aComp ); +// aSewingTool.Perform(); +// aShape = aSewingTool.SewedShape(); +// if ( aShape.IsNull() ) +// aShape = aComp; +// +// ShapeUpgrade_UnifySameDomain anUSD(aShape); +// anUSD.SetLinearTolerance(1e-5); +// anUSD.Build(); +// aShape = anUSD.Shape(); +// +// if (aShape.ShapeType() == TopAbs_SHELL && TopoDS::Shell(aShape).Closed()) +// { +// TopoDS_Solid aSolid; +// TopoDS_Shell aShell = TopoDS::Shell (aShape); +// if (!aShell.Free ()) { +// aShell.Free(Standard_True); +// } +// BRep_Builder aBuilder; +// aBuilder.MakeSolid (aSolid); +// aBuilder.Add (aSolid, aShell); +// +// Standard_Boolean isOk = Standard_True; +// try { +// OCC_CATCH_SIGNALS +// BRepClass3d_SolidClassifier bsc3d (aSolid); +// Standard_Real t = Precision::Confusion(); +// bsc3d.PerformInfinitePoint(t); +// +// if (bsc3d.State() == TopAbs_IN) { +// TopoDS_Solid aSolid2; +// aBuilder.MakeSolid (aSolid2); +// aShell.Reverse(); +// aBuilder.Add (aSolid2, aShell); +// aSolid = aSolid2; +// } +// } +// catch (Standard_Failure) { isOk = Standard_False; } +// if (isOk) aShape = aSolid; +// } +// +// // Trying to apply "Combine to Cylinder" +// +// //ShapeUpgrade_CombineToCylinder cmb2Cyl; +// //Standard_Boolean isOk = Standard_True; +// //try { +// // OCC_CATCH_SIGNALS +// // cmb2Cyl.SetShape(aShape); +// // cmb2Cyl.SetAngularTolerance(20); +// // cmb2Cyl.SetLinearTolerance(3); +// // cmb2Cyl.Build(); +// //} +// //catch (Standard_Failure) { isOk = Standard_False; } +// //if (isOk && cmb2Cyl.IsDone()) +// // aShape = cmb2Cyl.Shape(); +// +// theShapeWithMesh = aShape.TShape(); +// } +//} +// //======================================================================= //function : readData //purpose : diff --git a/src/XCAFDoc/XCAFDoc.cxx b/src/XCAFDoc/XCAFDoc.cxx index 0c3b9b1802..876b89ac5e 100644 --- a/src/XCAFDoc/XCAFDoc.cxx +++ b/src/XCAFDoc/XCAFDoc.cxx @@ -277,17 +277,6 @@ Standard_GUID XCAFDoc::ViewRefEnabledShapesGUID() //purpose : //======================================================================= -Standard_GUID XCAFDoc::ViewRefNoteGUID() -{ - static Standard_GUID ID("C814ACC6-43AC-4812-9B2A-4E9A2A549354"); - return ID; -} - -//======================================================================= -//function : ViewRefPlaneGUID -//purpose : -//======================================================================= - Standard_GUID XCAFDoc::ViewRefAnnotationGUID() { static Standard_GUID ID("A2B5BA42-DD00-43f5-8882-4B5F8E76B9D2"); diff --git a/src/XCAFDoc/XCAFDoc.hxx b/src/XCAFDoc/XCAFDoc.hxx index d785fc2003..c4548a4b69 100644 --- a/src/XCAFDoc/XCAFDoc.hxx +++ b/src/XCAFDoc/XCAFDoc.hxx @@ -134,7 +134,6 @@ public: Standard_EXPORT static Standard_GUID ClipPlaneVisibleRefGUID(); //! Return GUIDs for GraphNode representing specified types of View - Standard_EXPORT static Standard_GUID ViewRefNoteGUID(); Standard_EXPORT static Standard_GUID ViewRefAnnotationGUID(); //! Returns GUID for UAttribute identifying lock flag diff --git a/src/XCAFDoc/XCAFDoc_AssemblyItemRef.cxx b/src/XCAFDoc/XCAFDoc_AssemblyItemRef.cxx index f666b962dd..6032233af1 100644 --- a/src/XCAFDoc/XCAFDoc_AssemblyItemRef.cxx +++ b/src/XCAFDoc/XCAFDoc_AssemblyItemRef.cxx @@ -34,14 +34,14 @@ enum { ExtraRef_SubshapeIndex }; -const Standard_GUID& +const Standard_GUID& XCAFDoc_AssemblyItemRef::GetID() { static Standard_GUID s_ID("3F2E4CD6-169B-4747-A321-5670E4291F5D"); return s_ID; } -Handle(XCAFDoc_AssemblyItemRef) +Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_AssemblyItemRef::Get(const TDF_Label& theLabel) { Handle(XCAFDoc_AssemblyItemRef) aThis; @@ -49,9 +49,9 @@ XCAFDoc_AssemblyItemRef::Get(const TDF_Label& theLabel) return aThis; } -Handle(XCAFDoc_AssemblyItemRef) +Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_AssemblyItemRef::Set(const TDF_Label& theLabel, - const XCAFDoc_AssemblyItemId& theItemId) +const XCAFDoc_AssemblyItemId& theItemId) { Handle(XCAFDoc_AssemblyItemRef) aThis; if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_AssemblyItemRef::GetID(), aThis)) @@ -63,10 +63,10 @@ XCAFDoc_AssemblyItemRef::Set(const TDF_Label& theLabel, return aThis; } -Handle(XCAFDoc_AssemblyItemRef) +Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_AssemblyItemRef::Set(const TDF_Label& theLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theAttrGUID) +const XCAFDoc_AssemblyItemId& theItemId, +const Standard_GUID& theAttrGUID) { Handle(XCAFDoc_AssemblyItemRef) aThis; if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_AssemblyItemRef::GetID(), aThis)) @@ -79,10 +79,10 @@ XCAFDoc_AssemblyItemRef::Set(const TDF_Label& theLabel, return aThis; } -Handle(XCAFDoc_AssemblyItemRef) +Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_AssemblyItemRef::Set(const TDF_Label& theLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_Integer theShapeIndex) +const XCAFDoc_AssemblyItemId& theItemId, +const Standard_Integer theShapeIndex) { Handle(XCAFDoc_AssemblyItemRef) aThis; if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_AssemblyItemRef::GetID(), aThis)) @@ -101,7 +101,7 @@ XCAFDoc_AssemblyItemRef::XCAFDoc_AssemblyItemRef() } -Standard_Boolean +Standard_Boolean XCAFDoc_AssemblyItemRef::IsOrphan() const { if (myItemId.IsNull()) @@ -152,31 +152,31 @@ XCAFDoc_AssemblyItemRef::IsOrphan() const return Standard_False; } -Standard_Boolean +Standard_Boolean XCAFDoc_AssemblyItemRef::HasExtraRef() const { return (myExtraRef != ExtraRef_None); } -Standard_Boolean +Standard_Boolean XCAFDoc_AssemblyItemRef::IsGUID() const { return (myExtraRef == ExtraRef_AttrGUID && Standard_GUID::CheckGUIDFormat(myExtraId.ToCString())); } -Standard_Boolean +Standard_Boolean XCAFDoc_AssemblyItemRef::IsSubshapeIndex() const { return (myExtraRef == ExtraRef_SubshapeIndex && myExtraId.IsIntegerValue()); } -const XCAFDoc_AssemblyItemId& +const XCAFDoc_AssemblyItemId& XCAFDoc_AssemblyItemRef::GetItem() const { return myItemId; } -Standard_GUID +Standard_GUID XCAFDoc_AssemblyItemRef::GetGUID() const { if (IsGUID()) @@ -185,7 +185,7 @@ XCAFDoc_AssemblyItemRef::GetGUID() const return Standard_GUID(); } -Standard_Integer +Standard_Integer XCAFDoc_AssemblyItemRef::GetSubshapeIndex() const { if (IsSubshapeIndex()) @@ -194,7 +194,7 @@ XCAFDoc_AssemblyItemRef::GetSubshapeIndex() const return 0; } -void +void XCAFDoc_AssemblyItemRef::SetItem(const XCAFDoc_AssemblyItemId& theItemId) { Backup(); @@ -223,13 +223,13 @@ void XCAFDoc_AssemblyItemRef::SetGUID(const Standard_GUID& theAttrGUID) Backup(); myExtraRef = ExtraRef_AttrGUID; Standard_Character aGUIDStr[Standard_GUID_SIZE + 1]; - theAttrGUID.ToCString(aGUIDStr); + theAttrGUID.ToCString(aGUIDStr); aGUIDStr[Standard_GUID_SIZE] = '\0'; myExtraId.Clear(); myExtraId.AssignCat(aGUIDStr); } -void +void XCAFDoc_AssemblyItemRef::SetSubshapeIndex(Standard_Integer theSubshapeIndex) { Backup(); @@ -238,7 +238,7 @@ XCAFDoc_AssemblyItemRef::SetSubshapeIndex(Standard_Integer theSubshapeIndex) myExtraId.AssignCat(theSubshapeIndex); } -void +void XCAFDoc_AssemblyItemRef::ClearExtraRef() { Backup(); @@ -246,61 +246,19 @@ XCAFDoc_AssemblyItemRef::ClearExtraRef() myExtraId.Clear(); } -void -XCAFDoc_AssemblyItemRef::SetItem(const TColStd_ListOfAsciiString& thePath) -{ - Backup(); - myItemId.Init(thePath); -} - -void -XCAFDoc_AssemblyItemRef::SetItem(const TCollection_AsciiString& theString) -{ - Backup(); - myItemId.Init(theString); -} - -void XCAFDoc_AssemblyItemRef::SetGUID(const Standard_GUID& theAttrGUID) -{ - Backup(); - myExtraRef = ExtraRef_AttrGUID; - Standard_Character aGUIDStr[Standard_GUID_SIZE + 1]; - theAttrGUID.ToCString(aGUIDStr); - aGUIDStr[Standard_GUID_SIZE] = '\0'; - myExtraId.Clear(); - myExtraId.AssignCat(aGUIDStr); -} - -void -XCAFDoc_AssemblyItemRef::SetSubshapeIndex(Standard_Integer theSubshapeIndex) -{ - Backup(); - myExtraRef = ExtraRef_SubshapeIndex; - myExtraId.Clear(); - myExtraId.AssignCat(theSubshapeIndex); -} - -void -XCAFDoc_AssemblyItemRef::ClearExtraRef() -{ - Backup(); - myExtraRef = ExtraRef_None; - myExtraId.Clear(); -} - -const Standard_GUID& +const Standard_GUID& XCAFDoc_AssemblyItemRef::ID() const { return GetID(); } -Handle(TDF_Attribute) +Handle(TDF_Attribute) XCAFDoc_AssemblyItemRef::NewEmpty() const { return new XCAFDoc_AssemblyItemRef(); } -void +void XCAFDoc_AssemblyItemRef::Restore(const Handle(TDF_Attribute)& theAttrFrom) { Handle(XCAFDoc_AssemblyItemRef) anOther = Handle(XCAFDoc_AssemblyItemRef)::DownCast(theAttrFrom); @@ -312,9 +270,9 @@ XCAFDoc_AssemblyItemRef::Restore(const Handle(TDF_Attribute)& theAttrFrom) } } -void +void XCAFDoc_AssemblyItemRef::Paste(const Handle(TDF_Attribute)& theAttrInto, - const Handle(TDF_RelocationTable)& /*theRT*/) const +const Handle(TDF_RelocationTable)& /*theRT*/) const { Handle(XCAFDoc_AssemblyItemRef) anOther = Handle(XCAFDoc_AssemblyItemRef)::DownCast(theAttrInto); if (!anOther.IsNull()) @@ -325,7 +283,7 @@ XCAFDoc_AssemblyItemRef::Paste(const Handle(TDF_Attribute)& theAttrInto, } } -Standard_OStream& +Standard_OStream& XCAFDoc_AssemblyItemRef::Dump(Standard_OStream& theOS) const { theOS << "Path: " << myItemId.ToString(); diff --git a/src/XCAFDoc/XCAFDoc_NotesTool.hxx b/src/XCAFDoc/XCAFDoc_NotesTool.hxx index d616cfef86..3d23dd06ac 100644 --- a/src/XCAFDoc/XCAFDoc_NotesTool.hxx +++ b/src/XCAFDoc/XCAFDoc_NotesTool.hxx @@ -84,7 +84,7 @@ public: DEFINE_STANDARD_RTTIEXT(XCAFDoc_NotesTool, TDF_Attribute) - Standard_EXPORT static const Standard_GUID& GetID(); + Standard_EXPORT static const Standard_GUID& GetID(); //! Create (if not exist) a notes tool from XCAFDoc on theLabel. Standard_EXPORT static Handle(XCAFDoc_NotesTool) Set(const TDF_Label& theLabel); @@ -131,10 +131,6 @@ public: //! \param [in] theItemId - assembly item ID. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const; - Standard_EXPORT TDF_Label FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID) const; - Standard_EXPORT TDF_Label FindAnnotatedItemSubshape(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex) const; //! Finds a label of the given labeled item in the annotated items hive. //! \param [in] theItemLabel - item label. @@ -146,28 +142,28 @@ public: //! \param [in] theGUID - assembly item's attribute GUID. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID) const; + const Standard_GUID& theGUID) const; //! Finds a label of the given labeled item's attribute in the annotated items hive. //! \param [in] theItemLabel - item label. //! \param [in] theGUID - item's attribute GUID. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItemAttr(const TDF_Label& theItemLabel, - const Standard_GUID& theGUID) const; + const Standard_GUID& theGUID) const; //! Finds a label of the given assembly item's subshape in the annotated items hive. //! \param [in] theItemId - assembly item ID. //! \param [in] theSubshapeIndex - assembly item's subshape index. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItemSubshape(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex) const; + Standard_Integer theSubshapeIndex) const; //! Finds a label of the given labeled item's subshape in the annotated items hive. //! \param [in] theItemLabel - item label. //! \param [in] theSubshapeIndex - labeled item's subshape index. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItemSubshape(const TDF_Label& theItemLabel, - Standard_Integer theSubshapeIndex) const; + Standard_Integer theSubshapeIndex) const; //! @} @@ -182,8 +178,8 @@ public: //! \param [in] theComment - textual comment. //! \return a handle to the base note attribute. Standard_EXPORT Handle(XCAFDoc_Note) CreateComment(const TCollection_ExtendedString& theUserName, - const TCollection_ExtendedString& theTimeStamp, - const TCollection_ExtendedString& theComment); + const TCollection_ExtendedString& theTimeStamp, + const TCollection_ExtendedString& theComment); //! Create a new 'balloon' note. //! Creates a new label under the notes hive and attaches \ref XCAFDoc_NoteBalloon @@ -193,8 +189,8 @@ public: //! \param [in] theComment - textual comment. //! \return a handle to the base note attribute. Standard_EXPORT Handle(XCAFDoc_Note) CreateBalloon(const TCollection_ExtendedString& theUserName, - const TCollection_ExtendedString& theTimeStamp, - const TCollection_ExtendedString& theComment); + const TCollection_ExtendedString& theTimeStamp, + const TCollection_ExtendedString& theComment); //! Create a new note with data loaded from a binary file. //! Creates a new label under the notes hive and attaches \ref XCAFDoc_NoteComment @@ -206,10 +202,10 @@ public: //! \param [in] theFile - input binary file. //! \return a handle to the base note attribute. Standard_EXPORT Handle(XCAFDoc_Note) CreateBinData(const TCollection_ExtendedString& theUserName, - const TCollection_ExtendedString& theTimeStamp, - const TCollection_ExtendedString& theTitle, - const TCollection_AsciiString& theMIMEtype, - OSD_File& theFile); + const TCollection_ExtendedString& theTimeStamp, + const TCollection_ExtendedString& theTitle, + const TCollection_AsciiString& theMIMEtype, + OSD_File& theFile); //! Create a new note with data loaded from a byte data array. //! Creates a new label under the notes hive and attaches \ref XCAFDoc_NoteComment @@ -221,10 +217,10 @@ public: //! \param [in] theData - byte data array. //! \return a handle to the base note attribute. Standard_EXPORT Handle(XCAFDoc_Note) CreateBinData(const TCollection_ExtendedString& theUserName, - const TCollection_ExtendedString& theTimeStamp, - const TCollection_ExtendedString& theTitle, - const TCollection_AsciiString& theMIMEtype, - const Handle(TColStd_HArray1OfByte)& theData); + const TCollection_ExtendedString& theTimeStamp, + const TCollection_ExtendedString& theTitle, + const TCollection_AsciiString& theMIMEtype, + const Handle(TColStd_HArray1OfByte)& theData); //! @} @@ -238,13 +234,7 @@ public: //! \param [out] theNoteLabels - sequence of labels. //! \return number of added labels. Standard_EXPORT Standard_Integer GetNotes(const XCAFDoc_AssemblyItemId& theItemId, - TDF_LabelSequence& theNoteLabels) const; - Standard_EXPORT Standard_Integer GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID, - TDF_LabelSequence& theNoteLabels) const; - Standard_EXPORT Standard_Integer GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex, - TDF_LabelSequence& theNoteLabels) const; + TDF_LabelSequence& theNoteLabels) const; //! Gets all note labels of the labeled item. //! Notes linked to item's attributes aren't @@ -253,7 +243,7 @@ public: //! \param [out] theNoteLabels - sequence of labels. //! \return number of added labels. Standard_EXPORT Standard_Integer GetNotes(const TDF_Label& theItemLabel, - TDF_LabelSequence& theNoteLabels) const; + TDF_LabelSequence& theNoteLabels) const; //! Gets all note labels of the assembly item's attribute. //! Notes linked to the item itself or to item's subshapes @@ -263,8 +253,8 @@ public: //! \param [out] theNoteLabels - sequence of labels. //! \return number of added labels. Standard_EXPORT Standard_Integer GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID, - TDF_LabelSequence& theNoteLabels) const; + const Standard_GUID& theGUID, + TDF_LabelSequence& theNoteLabels) const; //! Gets all note labels of the labeled item's attribute. //! Notes linked to the item itself or to item's subshapes @@ -274,8 +264,8 @@ public: //! \param [out] theNoteLabels - sequence of labels. //! \return number of added labels. Standard_EXPORT Standard_Integer GetAttrNotes(const TDF_Label& theItemLabel, - const Standard_GUID& theGUID, - TDF_LabelSequence& theNoteLabels) const; + const Standard_GUID& theGUID, + TDF_LabelSequence& theNoteLabels) const; //! Gets all note labels of the annotated item. //! Notes linked to the item itself or to item's attributes @@ -285,8 +275,8 @@ public: //! \param [out] theNoteLabels - sequence of labels. //! \return number of added labels. Standard_EXPORT Standard_Integer GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex, - TDF_LabelSequence& theNoteLabels) const; + Standard_Integer theSubshapeIndex, + TDF_LabelSequence& theNoteLabels) const; //! @} @@ -298,20 +288,14 @@ public: //! \param [in] theItemId - assembly item ID. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNote(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId); - Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToAttr(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID); - Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToSubshape(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex); + const XCAFDoc_AssemblyItemId& theItemId); //! Adds the given note to the labeled item. //! \param [in] theNoteLabel - note label. //! \param [in] theItemLabel - item label. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNote(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel); + const TDF_Label& theItemLabel); //! Adds the given note to the assembly item's attribute. //! \param [in] theNoteLabel - note label. @@ -319,8 +303,8 @@ public: //! \param [in] theGUID - assembly item's attribute GUID. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToAttr(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID); + const XCAFDoc_AssemblyItemId& theItemId, + const Standard_GUID& theGUID); //! Adds the given note to the labeled item's attribute. //! \param [in] theNoteLabel - note label. @@ -328,8 +312,8 @@ public: //! \param [in] theGUID - assembly item's attribute GUID. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToAttr(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel, - const Standard_GUID& theGUID); + const TDF_Label& theItemLabel, + const Standard_GUID& theGUID); //! Adds the given note to the assembly item's subshape. //! \param [in] theNoteLabel - note label. @@ -337,8 +321,8 @@ public: //! \param [in] theSubshapeIndex - assembly item's subshape index. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToSubshape(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex); + const XCAFDoc_AssemblyItemId& theItemId, + Standard_Integer theSubshapeIndex); //! Adds the given note to the labeled item's subshape. //! \param [in] theNoteLabel - note label. @@ -346,8 +330,8 @@ public: //! \param [in] theSubshapeIndex - assembly item's subshape index. //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToSubshape(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel, - Standard_Integer theSubshapeIndex); + const TDF_Label& theItemLabel, + Standard_Integer theSubshapeIndex); //! @} @@ -362,8 +346,8 @@ public: //! linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveNote(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - Standard_Boolean theDelIfOrphan = Standard_False); + const XCAFDoc_AssemblyItemId& theItemId, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes the given note from the labeled item. //! \param [in] theNoteLabel - note label. @@ -373,8 +357,8 @@ public: //! linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveNote(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel, - Standard_Boolean theDelIfOrphan = Standard_False); + const TDF_Label& theItemLabel, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes the given note from the assembly item's subshape. //! \param [in] theNoteLabel - note label. @@ -385,9 +369,9 @@ public: //! subshape linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveSubshapeNote(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex, - Standard_Boolean theDelIfOrphan = Standard_False); + const XCAFDoc_AssemblyItemId& theItemId, + Standard_Integer theSubshapeIndex, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes the given note from the labeled item's subshape. //! \param [in] theNoteLabel - note label. @@ -398,9 +382,9 @@ public: //! subshape linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveSubshapeNote(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel, - Standard_Integer theSubshapeIndex, - Standard_Boolean theDelIfOrphan = Standard_False); + const TDF_Label& theItemLabel, + Standard_Integer theSubshapeIndex, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes a note from the assembly item's attribute. //! \param [in] theNoteLabel - note label. @@ -411,9 +395,9 @@ public: //! attribute linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAttrNote(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID, - Standard_Boolean theDelIfOrphan = Standard_False); + const XCAFDoc_AssemblyItemId& theItemId, + const Standard_GUID& theGUID, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes a note from the labeled item's attribute. //! \param [in] theNoteLabel - note label. @@ -424,9 +408,9 @@ public: //! attribute linked with the note. //! \return true if the note is removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAttrNote(const TDF_Label& theNoteLabel, - const TDF_Label& theItemLabel, - const Standard_GUID& theGUID, - Standard_Boolean theDelIfOrphan = Standard_False); + const TDF_Label& theItemLabel, + const Standard_GUID& theGUID, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes all notes from the assembly item. //! \param [in] theItemId - assembly item ID. @@ -435,7 +419,7 @@ public: //! linked with the notes. //! \return true if the notes are removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAllNotes(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Boolean theDelIfOrphan = Standard_False); + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes all notes from the labeled item. //! \param [in] theItemLabel - item label. @@ -444,7 +428,7 @@ public: //! linked with the notes. //! \return true if the notes are removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAllNotes(const TDF_Label& theItemLabel, - Standard_Boolean theDelIfOrphan = Standard_False); + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes all notes from the assembly item's subshape. //! \param [in] theItemId - assembly item ID. @@ -454,8 +438,8 @@ public: //! linked with the notes. //! \return true if the notes are removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAllSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex, - Standard_Boolean theDelIfOrphan = Standard_False); + Standard_Integer theSubshapeIndex, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes all notes from the assembly item's attribute. //! \param [in] theItemId - assembly item ID. @@ -465,8 +449,8 @@ public: //! linked with the notes. //! \return true if the notes are removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAllAttrNotes(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID, - Standard_Boolean theDelIfOrphan = Standard_False); + const Standard_GUID& theGUID, + Standard_Boolean theDelIfOrphan = Standard_False); //! Removes all notes from the labeled item's attribute. //! \param [in] theItemLabel - item label. @@ -476,8 +460,8 @@ public: //! linked with the notes. //! \return true if the notes are removed, otherwise - false. Standard_EXPORT Standard_Boolean RemoveAllAttrNotes(const TDF_Label& theItemLabel, - const Standard_GUID& theGUID, - Standard_Boolean theDelIfOrphan = Standard_False); + const Standard_GUID& theGUID, + Standard_Boolean theDelIfOrphan = Standard_False); //! @} @@ -513,7 +497,7 @@ public: //! The label sequence isn't cleared beforehand. //! \param [out] theNoteLabels - sequence of labels. Standard_EXPORT void GetOrphanNotes(TDF_LabelSequence& theNoteLabels) const; - + //! Deletes all notes that aren't linked to annotated items. //! \return number of deleted notes. Standard_EXPORT Standard_Integer DeleteOrphanNotes(); @@ -526,8 +510,8 @@ public: Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE; - Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theAttrInto, - const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; + Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theAttrInto, + const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS) const Standard_OVERRIDE; }; diff --git a/src/XCAFDoc/XCAFDoc_ViewTool.hxx b/src/XCAFDoc/XCAFDoc_ViewTool.hxx index e1c952651f..80ab5af2fb 100644 --- a/src/XCAFDoc/XCAFDoc_ViewTool.hxx +++ b/src/XCAFDoc/XCAFDoc_ViewTool.hxx @@ -113,10 +113,7 @@ public: //! Returns all View labels defined for label Shapes transparency Standard_EXPORT Standard_Boolean GetViewLabelsForEnabledShapesLabel(const TDF_Label& theShapesTransparencyL, TDF_LabelSequence& theViews) const; - - //! Returns all View labels defined for label NotesL - Standard_EXPORT Standard_Boolean GetViewLabelsForNote(const TDF_Label& theNoteL, TDF_LabelSequence& theViews) const; - + //! Adds a view definition to a View table and returns its label Standard_EXPORT TDF_Label AddView() ;