mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032724: Coding Rules, Graphic3d_Structure - remove unused property Graphic3d_Structure::ContainsFacet()
This commit is contained in:
parent
18c678759e
commit
bf2884afbe
@ -29,7 +29,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient)
|
|||||||
Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager)
|
Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager)
|
||||||
: Priority (Structure_MAX_PRIORITY / 2),
|
: Priority (Structure_MAX_PRIORITY / 2),
|
||||||
PreviousPriority (Structure_MAX_PRIORITY / 2),
|
PreviousPriority (Structure_MAX_PRIORITY / 2),
|
||||||
ContainsFacet (0),
|
|
||||||
//
|
//
|
||||||
myGraphicDriver (theManager->GraphicDriver()),
|
myGraphicDriver (theManager->GraphicDriver()),
|
||||||
myZLayer (Graphic3d_ZLayerId_Default),
|
myZLayer (Graphic3d_ZLayerId_Default),
|
||||||
@ -67,7 +66,6 @@ void Graphic3d_CStructure::DumpJson (Standard_OStream& theOStream, Standard_Inte
|
|||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayer)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayer)
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Priority)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Priority)
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PreviousPriority)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PreviousPriority)
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ContainsFacet)
|
|
||||||
|
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsInfinite)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsInfinite)
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, stick)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, stick)
|
||||||
|
@ -211,8 +211,6 @@ public:
|
|||||||
Standard_Integer Priority;
|
Standard_Integer Priority;
|
||||||
Standard_Integer PreviousPriority;
|
Standard_Integer PreviousPriority;
|
||||||
|
|
||||||
Standard_Integer ContainsFacet;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! Create empty structure.
|
//! Create empty structure.
|
||||||
|
@ -384,38 +384,6 @@ void Graphic3d_CView::InvalidateZLayerBoundingBox (const Graphic3d_ZLayerId theL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : ContainsFacet
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
Standard_Boolean Graphic3d_CView::ContainsFacet() const
|
|
||||||
{
|
|
||||||
for (Graphic3d_MapOfStructure::Iterator aStructIter (myStructsDisplayed); aStructIter.More(); aStructIter.Next())
|
|
||||||
{
|
|
||||||
if (aStructIter.Key()->ContainsFacet())
|
|
||||||
{
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : ContainsFacet
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
Standard_Boolean Graphic3d_CView::ContainsFacet (const Graphic3d_MapOfStructure& theSet) const
|
|
||||||
{
|
|
||||||
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (theSet); aStructIter.More(); aStructIter.Next())
|
|
||||||
{
|
|
||||||
if (aStructIter.Key()->ContainsFacet())
|
|
||||||
{
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : DisplayedStructures
|
// function : DisplayedStructures
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -134,12 +134,6 @@ public:
|
|||||||
//! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
//! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
||||||
Standard_EXPORT void Compute();
|
Standard_EXPORT void Compute();
|
||||||
|
|
||||||
//! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles.
|
|
||||||
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
|
||||||
|
|
||||||
//! Returns Standard_True if one of the structures in the set contains Polygons, Triangles or Quadrangles.
|
|
||||||
Standard_EXPORT Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure& theSet) const;
|
|
||||||
|
|
||||||
//! Returns the set of structures displayed in this view.
|
//! Returns the set of structures displayed in this view.
|
||||||
Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& theStructures) const;
|
Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& theStructures) const;
|
||||||
|
|
||||||
|
@ -47,9 +47,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Group,Standard_Transient)
|
|||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& theStruct)
|
Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& theStruct)
|
||||||
: myStructure (theStruct.operator->()),
|
: myStructure(theStruct.operator->()),
|
||||||
myIsClosed (false),
|
myIsClosed (false)
|
||||||
myContainsFacet (false)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@ -77,12 +76,6 @@ void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
|
|||||||
|
|
||||||
myBounds.Clear();
|
myBounds.Clear();
|
||||||
|
|
||||||
if (myContainsFacet)
|
|
||||||
{
|
|
||||||
myStructure->GroupsWithFacet (-1);
|
|
||||||
myContainsFacet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear method could be used on Graphic3d_Structure destruction,
|
// clear method could be used on Graphic3d_Structure destruction,
|
||||||
// and its structure manager could be already destroyed, in that
|
// and its structure manager could be already destroyed, in that
|
||||||
// case we don't need to update it;
|
// case we don't need to update it;
|
||||||
@ -103,11 +96,6 @@ void Graphic3d_Group::Remove()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myContainsFacet)
|
|
||||||
{
|
|
||||||
myStructure->GroupsWithFacet (-1);
|
|
||||||
myContainsFacet = false;
|
|
||||||
}
|
|
||||||
myStructure->Remove (this);
|
myStructure->Remove (this);
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
@ -255,21 +243,13 @@ void Graphic3d_Group::AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray th
|
|||||||
const Handle(Graphic3d_BoundBuffer)& ,
|
const Handle(Graphic3d_BoundBuffer)& ,
|
||||||
const Standard_Boolean theToEvalMinMax)
|
const Standard_Boolean theToEvalMinMax)
|
||||||
{
|
{
|
||||||
|
(void )theType;
|
||||||
if (IsDeleted()
|
if (IsDeleted()
|
||||||
|| theAttribs.IsNull())
|
|| theAttribs.IsNull())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!myContainsFacet
|
|
||||||
&& theType != Graphic3d_TOPA_POLYLINES
|
|
||||||
&& theType != Graphic3d_TOPA_SEGMENTS
|
|
||||||
&& theType != Graphic3d_TOPA_POINTS)
|
|
||||||
{
|
|
||||||
myStructure->GroupsWithFacet (1);
|
|
||||||
myContainsFacet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!theToEvalMinMax)
|
if (!theToEvalMinMax)
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
@ -481,5 +461,4 @@ void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, Standard_Integer t
|
|||||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBounds)
|
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBounds)
|
||||||
|
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed)
|
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed)
|
||||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet)
|
|
||||||
}
|
}
|
||||||
|
@ -140,9 +140,6 @@ public:
|
|||||||
//! Set transformation persistence.
|
//! Set transformation persistence.
|
||||||
Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
|
Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
|
||||||
|
|
||||||
//! Returns true if the group contains Polygons, Triangles or Quadrangles.
|
|
||||||
bool ContainsFacet() const { return myContainsFacet; }
|
|
||||||
|
|
||||||
//! Returns Standard_True if the group <me> is deleted.
|
//! Returns Standard_True if the group <me> is deleted.
|
||||||
//! <me> is deleted after the call Remove (me) or the
|
//! <me> is deleted after the call Remove (me) or the
|
||||||
//! associated structure is deleted.
|
//! associated structure is deleted.
|
||||||
@ -301,7 +298,6 @@ protected:
|
|||||||
Graphic3d_Structure* myStructure; //!< pointer to the parent structure
|
Graphic3d_Structure* myStructure; //!< pointer to the parent structure
|
||||||
Graphic3d_BndBox4f myBounds; //!< bounding box
|
Graphic3d_BndBox4f myBounds; //!< bounding box
|
||||||
bool myIsClosed; //!< flag indicating closed volume
|
bool myIsClosed; //!< flag indicating closed volume
|
||||||
bool myContainsFacet; //!< flag indicating that this group contains face primitives
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ void Graphic3d_Structure::clear (const Standard_Boolean theWithDestruction)
|
|||||||
// clean groups in graphics driver at first
|
// clean groups in graphics driver at first
|
||||||
GraphicClear (theWithDestruction);
|
GraphicClear (theWithDestruction);
|
||||||
|
|
||||||
myCStructure->ContainsFacet = 0;
|
|
||||||
myCStructure->SetGroupTransformPersistence (false);
|
myCStructure->SetGroupTransformPersistence (false);
|
||||||
myStructureManager->Clear (this, theWithDestruction);
|
myStructureManager->Clear (this, theWithDestruction);
|
||||||
|
|
||||||
@ -294,33 +293,6 @@ void Graphic3d_Structure::UnHighlight()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
//function : ContainsFacet
|
|
||||||
//purpose :
|
|
||||||
//=============================================================================
|
|
||||||
Standard_Boolean Graphic3d_Structure::ContainsFacet() const
|
|
||||||
{
|
|
||||||
if (IsDeleted())
|
|
||||||
{
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
else if (myCStructure->ContainsFacet > 0)
|
|
||||||
{
|
|
||||||
// if one of groups contains at least one facet, the structure contains it too
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
|
|
||||||
// stop at the first descendant containing at least one facet
|
|
||||||
for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
|
|
||||||
{
|
|
||||||
if (anIter.Value()->ContainsFacet())
|
|
||||||
{
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//function : IsEmpty
|
//function : IsEmpty
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -355,19 +327,6 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
//function : GroupsWithFacet
|
|
||||||
//purpose :
|
|
||||||
//=============================================================================
|
|
||||||
void Graphic3d_Structure::GroupsWithFacet (const Standard_Integer theDelta)
|
|
||||||
{
|
|
||||||
myCStructure->ContainsFacet = myCStructure->ContainsFacet + theDelta;
|
|
||||||
if (myCStructure->ContainsFacet < 0)
|
|
||||||
{
|
|
||||||
myCStructure->ContainsFacet = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//function : ReCompute
|
//function : ReCompute
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -198,10 +198,6 @@ public:
|
|||||||
//! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
|
//! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
|
||||||
Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
|
Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
|
||||||
|
|
||||||
//! Returns Standard_True if the structure <me> contains
|
|
||||||
//! Polygons, Triangles or Quadrangles.
|
|
||||||
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
|
||||||
|
|
||||||
//! Returns the groups sequence included in this structure.
|
//! Returns the groups sequence included in this structure.
|
||||||
const Graphic3d_SequenceOfGroup& Groups() const { return myCStructure->Groups(); }
|
const Graphic3d_SequenceOfGroup& Groups() const { return myCStructure->Groups(); }
|
||||||
|
|
||||||
@ -477,12 +473,6 @@ private:
|
|||||||
//! It will be erased at the next screen update.
|
//! It will be erased at the next screen update.
|
||||||
Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
|
Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
|
||||||
|
|
||||||
//! Manages the number of groups in the structure <me>
|
|
||||||
//! which contains facet.
|
|
||||||
//! Polygons, Triangles or Quadrangles.
|
|
||||||
//! <ADelta> = +1 or -1
|
|
||||||
Standard_EXPORT void GroupsWithFacet (const Standard_Integer ADelta);
|
|
||||||
|
|
||||||
//! Returns the extreme coordinates found in the structure <me> without transformation applied.
|
//! Returns the extreme coordinates found in the structure <me> without transformation applied.
|
||||||
Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
|
Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ OpenGl_StructureShadow::OpenGl_StructureShadow (const Handle(Graphic3d_Structure
|
|||||||
Handle(OpenGl_StructureShadow) aShadow = Handle(OpenGl_StructureShadow)::DownCast (theStructure);
|
Handle(OpenGl_StructureShadow) aShadow = Handle(OpenGl_StructureShadow)::DownCast (theStructure);
|
||||||
myParent = aShadow.IsNull() ? theStructure : aShadow->myParent;
|
myParent = aShadow.IsNull() ? theStructure : aShadow->myParent;
|
||||||
|
|
||||||
ContainsFacet = myParent->ContainsFacet;
|
|
||||||
IsInfinite = myParent->IsInfinite;
|
IsInfinite = myParent->IsInfinite;
|
||||||
myBndBox = myParent->BoundingBox();
|
myBndBox = myParent->BoundingBox();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user