From 8bed5c1eb433be158da783483f76fa0dff684312 Mon Sep 17 00:00:00 2001 From: vpa Date: Wed, 6 Apr 2016 20:28:05 +0300 Subject: [PATCH] Unify naming of LODs in all classes and methods --- src/Graphic3d/Graphic3d_CStructure.hxx | 6 +-- src/Graphic3d/Graphic3d_LODManager.cxx | 50 +++++++++--------- src/Graphic3d/Graphic3d_LODManager.hxx | 16 +++--- src/Graphic3d/Graphic3d_Structure.cxx | 16 +++--- src/Graphic3d/Graphic3d_Structure.hxx | 4 +- src/MeshVS/MeshVS_LODBuilder.cxx | 10 ++-- src/MeshVS/MeshVS_Mesh.cxx | 16 +++--- src/MeshVS/MeshVS_Mesh.hxx | 2 +- src/OpenGl/OpenGl_LODManager.cxx | 16 +++--- src/OpenGl/OpenGl_Structure.cxx | 14 ++--- src/OpenGl/OpenGl_Structure.hxx | 2 +- src/PrsMgr/PrsMgr_PresentableObject.cxx | 6 +-- src/PrsMgr/PrsMgr_PresentableObject.hxx | 2 +- src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx | 70 ++++++++++++------------- 14 files changed, 115 insertions(+), 115 deletions(-) diff --git a/src/Graphic3d/Graphic3d_CStructure.hxx b/src/Graphic3d/Graphic3d_CStructure.hxx index f15acb4f82..4cfaed2f67 100644 --- a/src/Graphic3d/Graphic3d_CStructure.hxx +++ b/src/Graphic3d/Graphic3d_CStructure.hxx @@ -83,7 +83,7 @@ public: //! Returns LOD manager for this structure. If the structure //! is not represented through LODs, the return value will //! be NULL pointer - const Handle(Graphic3d_LODManager)& GetLodManager() const + const Handle(Graphic3d_LODManager)& GetLODManager() const { return myLODManager; } @@ -132,10 +132,10 @@ public: virtual Standard_Integer NbDetailLevels() const = 0; //! Sets range of LOD. - //! @param theLodIdx corresponds to the index of LOD in map of LOD manager. In case if no LOD was + //! @param theLODIdx corresponds to the index of LOD in map of LOD manager. In case if no LOD was //! removed, the LODs in map are located in order of addition and IDs are identical to the addition //! iteration number - virtual void SetDetailLevelRange (const Standard_Integer theLodIdx, const Standard_Real theFrom, const Standard_Real theTo) = 0; + virtual void SetDetailLevelRange (const Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo) = 0; public: diff --git a/src/Graphic3d/Graphic3d_LODManager.cxx b/src/Graphic3d/Graphic3d_LODManager.cxx index 93db010245..c8e696ad67 100644 --- a/src/Graphic3d/Graphic3d_LODManager.cxx +++ b/src/Graphic3d/Graphic3d_LODManager.cxx @@ -23,8 +23,8 @@ IMPLEMENT_STANDARD_RTTIEXT (Graphic3d_LODManager, Standard_Transient) // purpose : //======================================================================= Graphic3d_LODManager::Graphic3d_LODManager (const Handle(Graphic3d_Structure)& theParentStructure) - : myLodIndexes (NULL), - myIsToSortLods (Standard_False), + : myLODIndexes (NULL), + myIsToSortLODs (Standard_False), myCurrentLODIdx (-1), mySelector (new Graphic3d_LODDistanceSelector()) { @@ -40,20 +40,20 @@ Graphic3d_LODManager::~Graphic3d_LODManager() Clear (Standard_True); myLODs.Clear(); - myLodIndexes.Nullify(); + myLODIndexes.Nullify(); mySelector.Nullify(); } //======================================================================= -// function : GetCurrentLODIdx +// function : HasLODToDisplay // purpose : //======================================================================= -Standard_Boolean Graphic3d_LODManager::HasLodToDisplay (const Handle(Graphic3d_Camera)& theCamera) +Standard_Boolean Graphic3d_LODManager::HasLODToDisplay (const Handle(Graphic3d_Camera)& theCamera) { if (theCamera->WorldViewProjState() == myPrevCameraState && myCurrentLODIdx != -1) return Standard_True; - if (myIsToSortLods) + if (myIsToSortLODs) sortLODs(); myPrevCameraState = theCamera->WorldViewProjState(); @@ -69,11 +69,11 @@ Standard_Boolean Graphic3d_LODManager::HasLodToDisplay (const Handle(Graphic3d_C } else { - for (Standard_Integer aLodIdx = 1; aLodIdx <= myLODs.Extent(); ++aLodIdx) + for (Standard_Integer aLODIdx = 1; aLODIdx <= myLODs.Extent(); ++aLODIdx) { - if (myLODs.FindKey (aLodIdx)->GetRange().IsIn (aMetric)) + if (myLODs.FindKey (aLODIdx)->GetRange().IsIn (aMetric)) { - myCurrentLODIdx = aLodIdx; + myCurrentLODIdx = aLODIdx; break; } } @@ -86,15 +86,15 @@ Standard_Boolean Graphic3d_LODManager::HasLodToDisplay (const Handle(Graphic3d_C // function : SetRange // purpose : //======================================================================= -void Graphic3d_LODManager::SetRange (Standard_Integer theLodIdx, +void Graphic3d_LODManager::SetRange (Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo) { - if (theLodIdx < 1 || theLodIdx > myLODs.Extent()) + if (theLODIdx < 1 || theLODIdx > myLODs.Extent()) return; - myLODs.FindKey (theLodIdx)->SetRange (theFrom, theTo); - myIsToSortLods = Standard_True; + myLODs.FindKey (theLODIdx)->SetRange (theFrom, theTo); + myIsToSortLODs = Standard_True; } //======================================================================= @@ -112,9 +112,9 @@ const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const //======================================================================= void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const { - for (Standard_Integer aLodIdx = 1; aLodIdx <= myLODs.Extent(); ++aLodIdx) + for (Standard_Integer aLODIdx = 1; aLODIdx <= myLODs.Extent(); ++aLODIdx) { - const Graphic3d_SequenceOfGroup& aGroups = myLODs.FindKey (aLodIdx)->GetDrawGroups(); + const Graphic3d_SequenceOfGroup& aGroups = myLODs.FindKey (aLODIdx)->GetDrawGroups(); for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next()) { theBndBox.Combine (aGroupIter.Value()->BoundingBox()); @@ -128,9 +128,9 @@ void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) con //======================================================================= Standard_Boolean Graphic3d_LODManager::IsEmpty() const { - for (Standard_Integer aLodIdx = 1; aLodIdx <= myLODs.Extent(); ++aLodIdx) + for (Standard_Integer aLODIdx = 1; aLODIdx <= myLODs.Extent(); ++aLODIdx) { - const Graphic3d_SequenceOfGroup& aGroups = myLODs.FindKey (aLodIdx)->GetDrawGroups(); + const Graphic3d_SequenceOfGroup& aGroups = myLODs.FindKey (aLODIdx)->GetDrawGroups(); if (!aGroups.IsEmpty()) return Standard_False; } @@ -144,25 +144,25 @@ Standard_Boolean Graphic3d_LODManager::IsEmpty() const //======================================================================= void Graphic3d_LODManager::Clear (const Standard_Boolean theWithDestruction) { - for (Standard_Integer aLodIdx = 1; aLodIdx <= myLODs.Extent(); ++aLodIdx) + for (Standard_Integer aLODIdx = 1; aLODIdx <= myLODs.Extent(); ++aLODIdx) { - myLODs.FindKey (aLodIdx)->Clear (theWithDestruction); + myLODs.FindKey (aLODIdx)->Clear (theWithDestruction); } } //======================================================================= -// function : GetLodById +// function : GetLODById // purpose : //======================================================================= -const Handle(Graphic3d_LOD)& Graphic3d_LODManager::GetLodById (const Standard_Integer theLodIdx) +const Handle(Graphic3d_LOD)& Graphic3d_LODManager::GetLODById (const Standard_Integer theLODIdx) { - Standard_ASSERT_RAISE (theLodIdx > 0 || theLodIdx <= myLODs.Size(), + Standard_ASSERT_RAISE (theLODIdx > 0 || theLODIdx <= myLODs.Size(), "Index of LOD is out of range"); - return myLODs.FindKey (theLodIdx); + return myLODs.FindKey (theLODIdx); } -Standard_Boolean Graphic3d_LODManager::HasLod (const Handle(Graphic3d_LOD)& theLod) const +Standard_Boolean Graphic3d_LODManager::HasLOD (const Handle(Graphic3d_LOD)& theLOD) const { - return myLODs.Contains (theLod); + return myLODs.Contains (theLOD); } diff --git a/src/Graphic3d/Graphic3d_LODManager.hxx b/src/Graphic3d/Graphic3d_LODManager.hxx index 97fbd14979..2d1e6206c1 100644 --- a/src/Graphic3d/Graphic3d_LODManager.hxx +++ b/src/Graphic3d/Graphic3d_LODManager.hxx @@ -62,13 +62,13 @@ public: } //! For ranged LODs, sets the distance interval where the LOD will be visible. - //! @param theLodIdx the index of LOD in sorted list - Standard_EXPORT void SetRange (const Standard_Integer theLodIdx, + //! @param theLODIdx the index of LOD in sorted list + Standard_EXPORT void SetRange (const Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo); //! Returns own index of the LOD that is displayed - Standard_EXPORT Standard_Boolean HasLodToDisplay (const Handle(Graphic3d_Camera)& theCamera); + Standard_EXPORT Standard_Boolean HasLODToDisplay (const Handle(Graphic3d_Camera)& theCamera); //! Returns graphic groups of the LOD that must be displayed according to the current //! camera state @@ -94,10 +94,10 @@ public: //! to the index of the LOD in the map of LOD manager. Therefore, in case if no LOD was //! removed, the LODs in map are located in order of addition and IDs are identical to //! the addition iteration number - Standard_EXPORT const Handle(Graphic3d_LOD)& GetLodById (const Standard_Integer theLodIdx); + Standard_EXPORT const Handle(Graphic3d_LOD)& GetLODById (const Standard_Integer theLODIdx); //! Checks if the given LOD is added to this manager - Standard_EXPORT Standard_Boolean HasLod (const Handle(Graphic3d_LOD)& theLod) const; + Standard_EXPORT Standard_Boolean HasLOD (const Handle(Graphic3d_LOD)& theLOD) const; DEFINE_STANDARD_RTTIEXT (Graphic3d_LODManager, Standard_Transient) @@ -107,13 +107,13 @@ protected: Standard_EXPORT Graphic3d_LODManager (const Handle(Graphic3d_Structure)& theParentStructure); //! Sorts LODs in the map according to its ranges to improve search for LOD to display. - //! After the sort is done, flag myIsToSortLods will be set to false. + //! After the sort is done, flag myIsToSortLODs will be set to false. Standard_EXPORT virtual void sortLODs() {}; protected: Graphic3d_MapOfLODs myLODs; //!< Map of LODs - Handle(TColStd_HArray1OfInteger) myLodIndexes; //!< Array of LOD indexes, for sorting purposes - Standard_Boolean myIsToSortLods; //!< Is true when LODs must be sorted before picking procedure. For example, when new LOD was added + Handle(TColStd_HArray1OfInteger) myLODIndexes; //!< Array of LOD indexes, for sorting purposes + Standard_Boolean myIsToSortLODs; //!< Is true when LODs must be sorted before picking procedure. For example, when new LOD was added private: Standard_Integer myCurrentLODIdx; //!< Index of current LOD that should be rendered; is -1 by default. diff --git a/src/Graphic3d/Graphic3d_Structure.cxx b/src/Graphic3d/Graphic3d_Structure.cxx index a00e02e25a..848a33ca1c 100644 --- a/src/Graphic3d/Graphic3d_Structure.cxx +++ b/src/Graphic3d/Graphic3d_Structure.cxx @@ -188,9 +188,9 @@ void Graphic3d_Structure::Remove() } // Clear LODs graphic groups if there are any - if (!myCStructure->GetLodManager().IsNull()) + if (!myCStructure->GetLODManager().IsNull()) { - myCStructure->GetLodManager()->Clear (Standard_False); + myCStructure->GetLODManager()->Clear (Standard_False); } // Destruction of me in the graphic library @@ -496,9 +496,9 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const // - if all these groups are empty // - or if all groups are empty and all their descendants are empty // - or if all its descendants are empty - if (!myCStructure->GetLodManager().IsNull()) + if (!myCStructure->GetLODManager().IsNull()) { - return myCStructure->GetLodManager()->IsEmpty(); + return myCStructure->GetLODManager()->IsEmpty(); } for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myCStructure->Groups()); aGroupIter.More(); aGroupIter.Next()) @@ -647,9 +647,9 @@ void Graphic3d_Structure::GraphicClear (const Standard_Boolean theWithDestructio return; } - if (!myCStructure->GetLodManager().IsNull()) + if (!myCStructure->GetLODManager().IsNull()) { - myCStructure->GetLodManager()->Clear (theWithDestruction); + myCStructure->GetLODManager()->Clear (theWithDestruction); if (theWithDestruction) myCStructure->Clear(); } @@ -1788,7 +1788,7 @@ Handle(Graphic3d_StructureManager) Graphic3d_Structure::StructureManager() const Graphic3d_BndBox4f Graphic3d_Structure::minMaxCoord() const { Graphic3d_BndBox4f aBnd; - if (myCStructure->GetLodManager().IsNull()) + if (myCStructure->GetLODManager().IsNull()) { for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myCStructure->Groups()); aGroupIter.More(); aGroupIter.Next()) { @@ -1797,7 +1797,7 @@ Graphic3d_BndBox4f Graphic3d_Structure::minMaxCoord() const } else { - myCStructure->GetLodManager()->GetCombinedBndBox (aBnd); + myCStructure->GetLODManager()->GetCombinedBndBox (aBnd); } return aBnd; } diff --git a/src/Graphic3d/Graphic3d_Structure.hxx b/src/Graphic3d/Graphic3d_Structure.hxx index ed4bffb059..932d547d54 100644 --- a/src/Graphic3d/Graphic3d_Structure.hxx +++ b/src/Graphic3d/Graphic3d_Structure.hxx @@ -488,10 +488,10 @@ public: Standard_EXPORT Standard_Integer NbDetailLevels() const; //! Sets range of LOD. - //! @param theLodIdx corresponds to the index of LOD in map of LOD manager. In case if no LOD was + //! @param theLODIdx corresponds to the index of LOD in map of LOD manager. In case if no LOD was //! removed, the LODs in map are located in order of addition and IDs are identical to the addition //! iteration number - Standard_EXPORT void SetDetailLevelRange (const Standard_Integer theIdOfLOD, const Standard_Real theFrom, const Standard_Real theTo); + Standard_EXPORT void SetDetailLevelRange (const Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo); friend class Graphic3d_Group; diff --git a/src/MeshVS/MeshVS_LODBuilder.cxx b/src/MeshVS/MeshVS_LODBuilder.cxx index c821d211e0..933f5ac19f 100644 --- a/src/MeshVS/MeshVS_LODBuilder.cxx +++ b/src/MeshVS/MeshVS_LODBuilder.cxx @@ -75,12 +75,12 @@ void MeshVS_LODBuilder::DrawArrays (const Handle(Prs3d_Presentation)& theBasePrs Aspect_TypeOfLine aType; Standard_Real aWidth; - Handle(Graphic3d_LOD) aNewLod = theBasePrs->NewLOD(); + Handle(Graphic3d_LOD) aNewLOD = theBasePrs->NewLOD(); theFillAsp->Values (aStyle, anIntColor, aBackColor, anEdgeColor, aType, aWidth); if (isPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01) { - Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs); + Handle (Graphic3d_Group) aGroup = aNewLOD->NewGroup (theBasePrs); theFillAsp->SetEdgeOff(); @@ -110,7 +110,7 @@ void MeshVS_LODBuilder::DrawArrays (const Handle(Prs3d_Presentation)& theBasePrs if (isPolylines && !theIsPolygonsEdgesOff) { - Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs); + Handle (Graphic3d_Group) aLGroup = aNewLOD->NewGroup (theBasePrs); theFillAsp->SetEdgeOff(); if (theIsSelected) @@ -126,7 +126,7 @@ void MeshVS_LODBuilder::DrawArrays (const Handle(Prs3d_Presentation)& theBasePrs if (isLinkPolylines) { - Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs); + Handle (Graphic3d_Group) aBeamGroup = aNewLOD->NewGroup (theBasePrs); theFillAsp->SetEdgeOff(); if (!theIsSelected) @@ -138,7 +138,7 @@ void MeshVS_LODBuilder::DrawArrays (const Handle(Prs3d_Presentation)& theBasePrs if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01) { - Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs); + Handle (Graphic3d_Group) aGroup = aNewLOD->NewGroup (theBasePrs); theFillAsp->SetEdgeOff(); diff --git a/src/MeshVS/MeshVS_Mesh.cxx b/src/MeshVS/MeshVS_Mesh.cxx index e1ebb90c32..bc7f048e8c 100644 --- a/src/MeshVS/MeshVS_Mesh.cxx +++ b/src/MeshVS/MeshVS_Mesh.cxx @@ -148,24 +148,24 @@ Standard_Boolean MeshVS_Mesh::HasLevelsOfDetail() const } //================================================================ -// Function : ComputeLods +// Function : ComputeLODs // Purpose : //================================================================ -void MeshVS_Mesh::ComputeLods (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, +void MeshVS_Mesh::ComputeLODs (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode) { TColStd_PackedMapOfInteger aDummy; - for (Standard_Integer aLodBldrIdx = 1; aLodBldrIdx <= myBuilders.Length(); ++aLodBldrIdx) + for (Standard_Integer aLODBldrIdx = 1; aLODBldrIdx <= myBuilders.Length(); ++aLODBldrIdx) { - const Handle(MeshVS_LODBuilder) aLodBldr = Handle(MeshVS_LODBuilder)::DownCast (myBuilders.Value (aLodBldrIdx)); - if (aLodBldr.IsNull()) + const Handle(MeshVS_LODBuilder) aLODBldr = Handle(MeshVS_LODBuilder)::DownCast (myBuilders.Value (aLODBldrIdx)); + if (aLODBldr.IsNull()) continue; - aLodBldr->SetPresentationManager (thePrsMgr); - const TColStd_PackedMapOfInteger aTrgIdxs = aLodBldr->GetDataSource()->GetAllElements(); + aLODBldr->SetPresentationManager (thePrsMgr); + const TColStd_PackedMapOfInteger aTrgIdxs = aLODBldr->GetDataSource()->GetAllElements(); if (!aTrgIdxs.IsEmpty()) - aLodBldr->Build (thePrs, aTrgIdxs, aDummy, Standard_True, theMode); + aLODBldr->Build (thePrs, aTrgIdxs, aDummy, Standard_True, theMode); } } diff --git a/src/MeshVS/MeshVS_Mesh.hxx b/src/MeshVS/MeshVS_Mesh.hxx index b5c914392e..7d649cada7 100644 --- a/src/MeshVS/MeshVS_Mesh.hxx +++ b/src/MeshVS/MeshVS_Mesh.hxx @@ -190,7 +190,7 @@ friend class MeshVS_PrsBuilder; protected: - Standard_EXPORT virtual void ComputeLods (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, + Standard_EXPORT virtual void ComputeLODs (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode = 0) Standard_OVERRIDE; diff --git a/src/OpenGl/OpenGl_LODManager.cxx b/src/OpenGl/OpenGl_LODManager.cxx index 21b2b53581..a0d3ee140e 100644 --- a/src/OpenGl/OpenGl_LODManager.cxx +++ b/src/OpenGl/OpenGl_LODManager.cxx @@ -63,7 +63,7 @@ Handle(Graphic3d_LOD) OpenGl_LODManager::AddNewLOD() { Handle(Graphic3d_LOD) aNewLOD = new OpenGl_LOD(); myLODs.Add (aNewLOD); - myIsToSortLods = Standard_True; + myIsToSortLODs = Standard_True; return aNewLOD; } @@ -73,14 +73,14 @@ Handle(Graphic3d_LOD) OpenGl_LODManager::AddNewLOD() //======================================================================= void OpenGl_LODManager::sortLODs() { - Standard_Integer aIndArrSize = myLODs.Extent(); - myLodIndexes.Nullify(); - myLodIndexes = new TColStd_HArray1OfInteger (0, aIndArrSize - 1); - for (Standard_Integer aIdx = 0; aIdx < aIndArrSize; ++aIdx) + Standard_Integer anIndArrSize = myLODs.Extent(); + myLODIndexes.Nullify(); + myLODIndexes = new TColStd_HArray1OfInteger (0, anIndArrSize - 1); + for (Standard_Integer anIdx = 0; anIdx < anIndArrSize; ++anIdx) { - myLodIndexes->SetValue (aIdx, aIdx + 1); + myLODIndexes->SetValue (anIdx, anIdx + 1); } - TColStd_Array1OfInteger& anIdxArr = myLodIndexes->ChangeArray1(); + TColStd_Array1OfInteger& anIdxArr = myLODIndexes->ChangeArray1(); std::sort (anIdxArr.begin(), anIdxArr.end(), CompareLODS (myLODs)); - myIsToSortLods = Standard_False; + myIsToSortLODs = Standard_False; } diff --git a/src/OpenGl/OpenGl_Structure.cxx b/src/OpenGl/OpenGl_Structure.cxx index 27ea268fea..fda97d06c9 100644 --- a/src/OpenGl/OpenGl_Structure.cxx +++ b/src/OpenGl/OpenGl_Structure.cxx @@ -560,7 +560,7 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con return; } - if (!myLODManager.IsNull() && !myLODManager->HasLodToDisplay (theWorkspace->View()->Camera())) + if (!myLODManager.IsNull() && !myLODManager->HasLODToDisplay (theWorkspace->View()->Camera())) return; const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext(); @@ -755,10 +755,10 @@ void OpenGl_Structure::ReleaseGlResources (const Handle(OpenGl_Context)& theGlCt } if (!myLODManager.IsNull()) { - for (Standard_Integer aLodIdx = 1; aLodIdx <= myLODManager->NbOfDetailLevels(); ++aLodIdx) + for (Standard_Integer aLODIdx = 1; aLODIdx <= myLODManager->NbOfDetailLevels(); ++aLODIdx) { - Handle(OpenGl_LOD) aLod = Handle(OpenGl_LOD)::DownCast (myLODManager->GetLodById (aLodIdx)); - aLod->ReleaseGraphicResources (theGlCtx); + Handle(OpenGl_LOD) aLOD = Handle(OpenGl_LOD)::DownCast (myLODManager->GetLODById (aLODIdx)); + aLOD->ReleaseGraphicResources (theGlCtx); } } if (myAspectLine != NULL) @@ -796,17 +796,17 @@ Handle(Graphic3d_CStructure) OpenGl_Structure::ShadowLink (const Handle(Graphic3 //function : SetDetailLevelRange //purpose : //======================================================================= -void OpenGl_Structure::SetDetailLevelRange (const Standard_Integer theLodIdx, +void OpenGl_Structure::SetDetailLevelRange (const Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo) { Standard_ASSERT_RAISE (theFrom < theTo, "The upper boundary of the interval must be greater than lower one!"); - if (myLODManager.IsNull() || theLodIdx < 1 || theLodIdx > myLODManager->NbOfDetailLevels()) + if (myLODManager.IsNull() || theLODIdx < 1 || theLODIdx > myLODManager->NbOfDetailLevels()) return; - myLODManager->SetRange (theLodIdx, theFrom, theTo); + myLODManager->SetRange (theLODIdx, theFrom, theTo); } //======================================================================= diff --git a/src/OpenGl/OpenGl_Structure.hxx b/src/OpenGl/OpenGl_Structure.hxx index b6d1a40345..aee75dcd59 100644 --- a/src/OpenGl/OpenGl_Structure.hxx +++ b/src/OpenGl/OpenGl_Structure.hxx @@ -106,7 +106,7 @@ public: //! Remove group from this structure Standard_EXPORT virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) Standard_OVERRIDE; - Standard_EXPORT virtual void SetDetailLevelRange (const Standard_Integer theLodIdx, + Standard_EXPORT virtual void SetDetailLevelRange (const Standard_Integer theLODIdx, const Standard_Real theFrom, const Standard_Real theTo) Standard_OVERRIDE; diff --git a/src/PrsMgr/PrsMgr_PresentableObject.cxx b/src/PrsMgr/PrsMgr_PresentableObject.cxx index 3998044d32..8028a8af46 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.cxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.cxx @@ -74,7 +74,7 @@ void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& t if (!HasLevelsOfDetail()) Compute (thePrsMgr, aStruct3d, theMode); else - ComputeLods (thePrsMgr, aStruct3d, theMode); + ComputeLODs (thePrsMgr, aStruct3d, theMode); UpdateTransformation (aStruct3d); aStruct3d->SetClipPlanes (myClipPlanes); aStruct3d->SetTransformPersistence (GetTransformPersistenceMode(), GetTransformPersistencePoint()); @@ -528,10 +528,10 @@ Standard_Boolean PrsMgr_PresentableObject::IsMutable() const } // ======================================================================= -// function : ComputeLods +// function : ComputeLODs // purpose : // ======================================================================= -void PrsMgr_PresentableObject::ComputeLods (const Handle(PrsMgr_PresentationManager3d)& /*thePrsMgr*/, +void PrsMgr_PresentableObject::ComputeLODs (const Handle(PrsMgr_PresentationManager3d)& /*thePrsMgr*/, const Handle(Prs3d_Presentation)& /*thePrs*/, const Standard_Integer /*theMode*/) { diff --git a/src/PrsMgr/PrsMgr_PresentableObject.hxx b/src/PrsMgr/PrsMgr_PresentableObject.hxx index da16843867..cb7ef36550 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.hxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.hxx @@ -226,7 +226,7 @@ protected: Standard_EXPORT virtual ~PrsMgr_PresentableObject(); //! Computes levels of detail for the presentation. - Standard_EXPORT virtual void ComputeLods (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, + Standard_EXPORT virtual void ComputeLODs (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode = 0); diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index bc67ce1e36..2865f3bf4b 100644 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -1213,10 +1213,10 @@ static Standard_Integer meshinfo(Draw_Interpretor& di, #include #include //======================================================================= -//function : VGenLods +//function : MeshGenLODs //purpose : Generates sequence of LODs for the shape given //======================================================================= -static int MeshGenLods (Draw_Interpretor& theDI, +static int MeshGenLODs (Draw_Interpretor& theDI, Standard_Integer theArgNum, const char** theArgs) { @@ -1241,10 +1241,10 @@ static int MeshGenLods (Draw_Interpretor& theDI, std::cout << "Error! No shape with the name " << aShapeName << "." << std::endl; return 1; } - const Standard_Integer aLodsNb = Draw::Atoi (theArgs[2]); - if (aLodsNb <= 0) + const Standard_Integer aLODsNb = Draw::Atoi (theArgs[2]); + if (aLODsNb <= 0) { - std::cout << "Error! Incorrect amount of LODs passed: " << aLodsNb << "." << std::endl; + std::cout << "Error! Incorrect amount of LODs passed: " << aLODsNb << "." << std::endl; std::cout << "Must be greater than zero." << std::endl; return 1; } @@ -1303,19 +1303,19 @@ static int MeshGenLods (Draw_Interpretor& theDI, // compute the shape for each LOD - TopoDS_Shape* aLodShapes = new TopoDS_Shape[aLodsNb]; + TopoDS_Shape* aLODShapes = new TopoDS_Shape[aLODsNb]; BRepBuilderAPI_Copy aMainCopyAlgo; aMainCopyAlgo.Perform (aShape, Standard_True, Standard_True); - aLodShapes[0] = aMainCopyAlgo.Shape(); - Standard_Real aDeflDecrFactor = aMaxDefl / aLodsNb; - for (Standard_Integer aLodIdx = 1; aLodIdx < aLodsNb; ++aLodIdx) + aLODShapes[0] = aMainCopyAlgo.Shape(); + Standard_Real aDeflDecrFactor = aMaxDefl / aLODsNb; + for (Standard_Integer aLODIdx = 1; aLODIdx < aLODsNb; ++aLODIdx) { BRepBuilderAPI_Copy aCopyAlgo; aCopyAlgo.Perform (aShape, Standard_True, Standard_True); - aLodShapes[aLodIdx] = aCopyAlgo.Shape(); - BRepTools::Clean (aLodShapes[aLodIdx]); + aLODShapes[aLODIdx] = aCopyAlgo.Shape(); + BRepTools::Clean (aLODShapes[aLODIdx]); BRepMesh_FastDiscret::Parameters aParams; - aParams.Deflection = aMaxDefl - aLodIdx * aDeflDecrFactor; + aParams.Deflection = aMaxDefl - aLODIdx * aDeflDecrFactor; aParams.Angle = 0.5; aParams.Relative = Standard_False; aParams.InParallel = Standard_False; @@ -1323,12 +1323,12 @@ static int MeshGenLods (Draw_Interpretor& theDI, aParams.InternalVerticesMode = Standard_True; aParams.ControlSurfaceDeflection = Standard_True; aParams.AdaptiveMin = Standard_False; - BRepMesh_IncrementalMesh aMesher (aLodShapes[aLodIdx], aParams); + BRepMesh_IncrementalMesh aMesher (aLODShapes[aLODIdx], aParams); aMesher.Perform(); if (toPrintInfo) { Standard_Integer aStatus = aMesher.GetStatusFlags(); - std::cout << "LOD #" << aLodIdx << " meshing status: "; + std::cout << "LOD #" << aLODIdx << " meshing status: "; if (!aStatus) std::cout << " OK" << std::endl; else @@ -1362,10 +1362,10 @@ static int MeshGenLods (Draw_Interpretor& theDI, if (toPrintInfo) { std::cout << std::endl; - for (Standard_Integer aLodIdx = 0; aLodIdx < aLodsNb; ++aLodIdx) + for (Standard_Integer aLODIdx = 0; aLODIdx < aLODsNb; ++aLODIdx) { - std::cout << "LOD #" << aLodIdx + 1 << " info:" << std::endl; - if (aLodShapes[aLodIdx].IsNull()) + std::cout << "LOD #" << aLODIdx + 1 << " info:" << std::endl; + if (aLODShapes[aLODIdx].IsNull()) { std::cout << "The shape is null!" << std::endl; } @@ -1374,7 +1374,7 @@ static int MeshGenLods (Draw_Interpretor& theDI, TopLoc_Location aCurLoc; Standard_Real aDefl = 0.0; Standard_Integer aTrgsNb = 0, aNodesNb = 0; - for (TopExp_Explorer aShapeExp (aLodShapes[aLodIdx], TopAbs_FACE); aShapeExp.More(); aShapeExp.Next()) + for (TopExp_Explorer aShapeExp (aLODShapes[aLODIdx], TopAbs_FACE); aShapeExp.More(); aShapeExp.Next()) { TopoDS_Face aCurFace = TopoDS::Face (aShapeExp.Current()); aCurTrg = BRep_Tool::Triangulation (aCurFace, aCurLoc); @@ -1400,12 +1400,12 @@ static int MeshGenLods (Draw_Interpretor& theDI, aSavePath = aSavePath + "/"; } aSavePath = aSavePath + aShapeName + "_LOD"; - for (Standard_Integer aLodIdx = 0; aLodIdx < aLodsNb; ++aLodIdx) + for (Standard_Integer aLODIdx = 0; aLODIdx < aLODsNb; ++aLODIdx) { StlAPI_Writer aWriter; aWriter.ASCIIMode() = Standard_False; - TCollection_AsciiString aPath = aSavePath + aLodIdx + ".stl"; - StlAPI_ErrorStatus aStatus = aWriter.Write (aLodShapes[aLodIdx], aPath.ToCString()); + TCollection_AsciiString aPath = aSavePath + aLODIdx + ".stl"; + StlAPI_ErrorStatus aStatus = aWriter.Write (aLODShapes[aLODIdx], aPath.ToCString()); switch (aStatus) { case StlAPI_CannotOpenFile: @@ -1413,7 +1413,7 @@ static int MeshGenLods (Draw_Interpretor& theDI, break; case StlAPI_StatusOK: default: - std::cout << "LOD" << aLodIdx << " was written sucessfully to the file " << aPath << std::endl; + std::cout << "LOD" << aLODIdx << " was written sucessfully to the file " << aPath << std::endl; } } } @@ -1422,7 +1422,7 @@ static int MeshGenLods (Draw_Interpretor& theDI, } #include -static int MeshLod (Draw_Interpretor& theDI, +static int MeshLOD (Draw_Interpretor& theDI, Standard_Integer theArgNum, const char** theArgs) { @@ -1515,12 +1515,12 @@ static int MeshLod (Draw_Interpretor& theDI, } Handle(MeshVS_Mesh) anOriginMesh = new MeshVS_Mesh(); - for (NCollection_List::Iterator aLodDataIter (myLODDataList); aLodDataIter.More(); aLodDataIter.Next()) + for (NCollection_List::Iterator aLODDataIter (myLODDataList); aLODDataIter.More(); aLODDataIter.Next()) { - Handle(MeshVS_LODDataSource) aLod = new MeshVS_LODDataSource (aLodDataIter.Value().myMesh); - anOriginMesh->AddDataSource (aLod); + Handle(MeshVS_LODDataSource) aLOD = new MeshVS_LODDataSource (aLODDataIter.Value().myMesh); + anOriginMesh->AddDataSource (aLOD); Handle(MeshVS_LODBuilder) aLODBuilder = new MeshVS_LODBuilder (anOriginMesh.operator->()); - aLODBuilder->SetDataSource (aLod); + aLODBuilder->SetDataSource (aLOD); aLODBuilder->GetDrawer()->SetColor (MeshVS_DA_EdgeColor, Quantity_NOC_YELLOW); anOriginMesh->AddBuilder (aLODBuilder); } @@ -1536,11 +1536,11 @@ static int MeshLod (Draw_Interpretor& theDI, VDisplayAISObject (aShapeName, anOriginMesh); aCtx->Deactivate (anOriginMesh); - Standard_Integer aLodIdx = 1; - for (NCollection_List::Iterator aLodDataIter (myLODDataList); aLodDataIter.More(); aLodDataIter.Next()) + Standard_Integer aLODIdx = 1; + for (NCollection_List::Iterator aLODDataIter (myLODDataList); aLODDataIter.More(); aLODDataIter.Next()) { - anOriginMesh->Presentation()->SetDetailLevelRange (aLodIdx, aLodDataIter.Value().myFrom, aLodDataIter.Value().myTo); - aLodIdx++; + anOriginMesh->Presentation()->SetDetailLevelRange (aLODIdx, aLODDataIter.Value().myFrom, aLODDataIter.Value().myTo); + aLODIdx++; } Draw::Set (aShapeName, new XSDRAWSTLVRML_DrawableMesh (anOriginMesh)); @@ -1587,18 +1587,18 @@ void XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands) "\n\t\t: lodsNb means the exact amount of physical LODs to generate, e.g. the main" "\n\t\t: object's presentation is not considered as a separate level of detail here." "\n\t\t: [-debug] enables printing of meshing status and each LOD's info.", - __FILE__, MeshGenLods, g); + __FILE__, MeshGenLODs, g); theCommands.Add ("meshlod", - "meshlod shapeName pathToFileWithLodInfo" + "meshlod shapeName pathToFileWithLODInfo" "\n\t\t: Creates an object with the name shapeName that has LODs described in file stored at" - "\n\t\t: pathToFileWithLodInfo. Each string in the file is a full description of LOD. It must" + "\n\t\t: pathToFileWithLODInfo. Each string in the file is a full description of LOD. It must" "\n\t\t: be filled using the following form:" "\n\t\t: -path pathToLOD [-from fromRange] [-to toRange], where" "\n\t\t: pathToLOD is a path to STL file with LOD mesh, fromRange and toRange define a depth" "\n\t\t: range where the LOD will be visible. Each of range parameters is optional, but in this" "\n\t\t: case, it will be equal to positive and negative max double correspondingly." "\n\t\t: It is assumed that ranges are non-overlapping segments of the real axis." - __FILE__, MeshLod, g); + __FILE__, MeshLOD, g); } //============================================================================== -- 2.39.5