]> OCCT Git - occt.git/commitdiff
0032724: Coding Rules, Graphic3d_Structure - remove unused property Graphic3d_Structu...
authorkgv <kgv@opencascade.com>
Wed, 8 Dec 2021 11:10:11 +0000 (14:10 +0300)
committersmoskvin <smoskvin@opencascade.com>
Wed, 8 Dec 2021 22:25:41 +0000 (01:25 +0300)
src/Graphic3d/Graphic3d_CStructure.cxx
src/Graphic3d/Graphic3d_CStructure.hxx
src/Graphic3d/Graphic3d_CView.cxx
src/Graphic3d/Graphic3d_CView.hxx
src/Graphic3d/Graphic3d_Group.cxx
src/Graphic3d/Graphic3d_Group.hxx
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_Structure.hxx
src/OpenGl/OpenGl_StructureShadow.cxx

index e60815de5352404bb8398353c2d589ec23b3faa2..bfde61d4b0cec7a2fd581fffae6c4b9d99e9d7f1 100644 (file)
@@ -29,7 +29,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient)
 Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager)
 : Priority         (Structure_MAX_PRIORITY / 2),
   PreviousPriority (Structure_MAX_PRIORITY / 2),
-  ContainsFacet    (0),
   //
   myGraphicDriver  (theManager->GraphicDriver()),
   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, Priority)
   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, stick)
index 1210025d754f402ffe4bb036ce8813ce3a8aacd1..b80d78ba44c212203ff47a65ea62fb6e7eb8bdd1 100644 (file)
@@ -211,8 +211,6 @@ public:
   Standard_Integer Priority;
   Standard_Integer PreviousPriority;
 
-  Standard_Integer ContainsFacet;
-
 protected:
 
   //! Create empty structure.
index 146196555279fdc0cbb3f1014bd944f563e00bde..6718b60ebf77b8f14bc9cd058878b812dafb83af 100644 (file)
@@ -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
 // purpose  :
index 6373a8dfb578ef0075ac4a176764f470124a475b..13cf37e1ebd6548dad6995e39f017b2d0c9b2d48 100644 (file)
@@ -134,12 +134,6 @@ public:
   //! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
   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.
   Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& theStructures) const;
 
index ad202ca899b83862ce4aeabf3e500bc838111057..1a704ec9d7f2b6dbf8b362184c45f58fe60ee1fe 100644 (file)
@@ -47,9 +47,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Group,Standard_Transient)
 // purpose  :
 // =======================================================================
 Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& theStruct)
-: myStructure     (theStruct.operator->()),
-  myIsClosed      (false),
-  myContainsFacet (false)
+: myStructure(theStruct.operator->()),
+  myIsClosed (false)
 {
   //
 }
@@ -77,12 +76,6 @@ void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
 
   myBounds.Clear();
 
-  if (myContainsFacet)
-  {
-    myStructure->GroupsWithFacet (-1);
-    myContainsFacet = false;
-  }
-
   // clear method could be used on Graphic3d_Structure destruction,
   // and its structure manager could be already destroyed, in that
   // case we don't need to update it;
@@ -103,11 +96,6 @@ void Graphic3d_Group::Remove()
     return;
   }
 
-  if (myContainsFacet)
-  {
-    myStructure->GroupsWithFacet (-1);
-    myContainsFacet = false;
-  }
   myStructure->Remove (this);
 
   Update();
@@ -255,21 +243,13 @@ void Graphic3d_Group::AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray th
                                          const Handle(Graphic3d_BoundBuffer)& ,
                                          const Standard_Boolean               theToEvalMinMax)
 {
+  (void )theType;
   if (IsDeleted()
    || theAttribs.IsNull())
   {
     return;
   }
 
-  if (!myContainsFacet
-    && theType != Graphic3d_TOPA_POLYLINES
-    && theType != Graphic3d_TOPA_SEGMENTS
-    && theType != Graphic3d_TOPA_POINTS)
-  {
-    myStructure->GroupsWithFacet (1);
-    myContainsFacet = true;
-  }
-
   if (!theToEvalMinMax)
   {
     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_VALUE_NUMERICAL (theOStream, myIsClosed)
-  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet)
 }
index c8462b90c7ad67d762ccf3857b22c73a3738aa4c..47db10e404827d6f03d9e6936c353638f5795cf7 100644 (file)
@@ -140,9 +140,6 @@ public:
   //! Set transformation persistence.
   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.
   //! <me> is deleted after the call Remove (me) or the
   //! associated structure is deleted.
@@ -301,7 +298,6 @@ protected:
   Graphic3d_Structure* myStructure;     //!< pointer to the parent structure
   Graphic3d_BndBox4f   myBounds;        //!< bounding box
   bool                 myIsClosed;      //!< flag indicating closed volume
-  bool                 myContainsFacet; //!< flag indicating that this group contains face primitives
 
 };
 
index cfe5ff8ecc9476411279a4b2f6f801fa19d891db..062b264097b2ac31e9d6b9eb9b8d674775ce3c6a 100644 (file)
@@ -85,7 +85,6 @@ void Graphic3d_Structure::clear (const Standard_Boolean theWithDestruction)
   // clean groups in graphics driver at first
   GraphicClear (theWithDestruction);
 
-  myCStructure->ContainsFacet = 0;
   myCStructure->SetGroupTransformPersistence (false);
   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
 //purpose  :
@@ -355,19 +327,6 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
   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
 //purpose  :
index 04fa9348e59012428157580a95d59cf6d59567a6..8b9e438173f18103d9b74f70e95c5582b7ee34c0 100644 (file)
@@ -198,10 +198,6 @@ public:
   //! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
   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.
   const Graphic3d_SequenceOfGroup& Groups() const { return myCStructure->Groups(); }
 
@@ -477,12 +473,6 @@ private:
   //! It will be erased at the next screen update.
   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.
   Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
   
index 64672018d60de5583916ad63314323d45ad7324d..c068661e434ba79072be202e62a67fecfc50bf0b 100644 (file)
@@ -31,7 +31,6 @@ OpenGl_StructureShadow::OpenGl_StructureShadow (const Handle(Graphic3d_Structure
   Handle(OpenGl_StructureShadow) aShadow = Handle(OpenGl_StructureShadow)::DownCast (theStructure);
   myParent = aShadow.IsNull() ? theStructure : aShadow->myParent;
 
-  ContainsFacet = myParent->ContainsFacet;
   IsInfinite    = myParent->IsInfinite;
   myBndBox      = myParent->BoundingBox();