//! 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;
}
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:
// 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())
{
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();
}
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;
}
}
// 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;
}
//=======================================================================
//=======================================================================
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());
//=======================================================================
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;
}
//=======================================================================
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);
}
}
//! 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
//! 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)
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.
}
// 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
// - 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())
return;
}
- if (!myCStructure->GetLodManager().IsNull())
+ if (!myCStructure->GetLODManager().IsNull())
{
- myCStructure->GetLodManager()->Clear (theWithDestruction);
+ myCStructure->GetLODManager()->Clear (theWithDestruction);
if (theWithDestruction)
myCStructure->Clear();
}
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())
{
}
else
{
- myCStructure->GetLodManager()->GetCombinedBndBox (aBnd);
+ myCStructure->GetLODManager()->GetCombinedBndBox (aBnd);
}
return aBnd;
}
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;
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();
if (isPolylines && !theIsPolygonsEdgesOff)
{
- Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs);
+ Handle (Graphic3d_Group) aLGroup = aNewLOD->NewGroup (theBasePrs);
theFillAsp->SetEdgeOff();
if (theIsSelected)
if (isLinkPolylines)
{
- Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs);
+ Handle (Graphic3d_Group) aBeamGroup = aNewLOD->NewGroup (theBasePrs);
theFillAsp->SetEdgeOff();
if (!theIsSelected)
if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01)
{
- Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
+ Handle (Graphic3d_Group) aGroup = aNewLOD->NewGroup (theBasePrs);
theFillAsp->SetEdgeOff();
}
//================================================================
-// 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);
}
}
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;
{
Handle(Graphic3d_LOD) aNewLOD = new OpenGl_LOD();
myLODs.Add (aNewLOD);
- myIsToSortLods = Standard_True;
+ myIsToSortLODs = Standard_True;
return aNewLOD;
}
//=======================================================================
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;
}
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();
}
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)
//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);
}
//=======================================================================
//! 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;
if (!HasLevelsOfDetail())
Compute (thePrsMgr, aStruct3d, theMode);
else
- ComputeLods (thePrsMgr, aStruct3d, theMode);
+ ComputeLODs (thePrsMgr, aStruct3d, theMode);
UpdateTransformation (aStruct3d);
aStruct3d->SetClipPlanes (myClipPlanes);
aStruct3d->SetTransformPersistence (GetTransformPersistenceMode(), GetTransformPersistencePoint());
}
// =======================================================================
-// 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*/)
{
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);
#include <TopoDS.hxx>
#include <ViewerTest_AutoUpdater.hxx>
//=======================================================================
-//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)
{
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;
}
// 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;
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
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;
}
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);
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:
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;
}
}
}
}
#include <MeshVS_LODBuilder.hxx>
-static int MeshLod (Draw_Interpretor& theDI,
+static int MeshLOD (Draw_Interpretor& theDI,
Standard_Integer theArgNum,
const char** theArgs)
{
}
Handle(MeshVS_Mesh) anOriginMesh = new MeshVS_Mesh();
- for (NCollection_List<DetailLevelData>::Iterator aLodDataIter (myLODDataList); aLodDataIter.More(); aLodDataIter.Next())
+ for (NCollection_List<DetailLevelData>::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);
}
VDisplayAISObject (aShapeName, anOriginMesh);
aCtx->Deactivate (anOriginMesh);
- Standard_Integer aLodIdx = 1;
- for (NCollection_List<DetailLevelData>::Iterator aLodDataIter (myLODDataList); aLodDataIter.More(); aLodDataIter.Next())
+ Standard_Integer aLODIdx = 1;
+ for (NCollection_List<DetailLevelData>::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));
"\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);
}
//==============================================================================