Browse Source

gobj: Delete assignment operator of Geom* classes

They are unused and it would probably be a bad idea to try to use them.
rdb 3 years ago
parent
commit
72f98ec30d

+ 0 - 20
panda/src/gobj/geom.cxx

@@ -62,26 +62,6 @@ Geom(const Geom &copy) :
 {
 }
 
-/**
- * The copy assignment operator is not pipeline-safe.  This will completely
- * obliterate all stages of the pipeline, so don't do it for a Geom that is
- * actively being used for rendering.
- */
-void Geom::
-operator = (const Geom &copy) {
-  CopyOnWriteObject::operator = (copy);
-
-  clear_cache();
-
-  _cycler = copy._cycler;
-
-  OPEN_ITERATE_ALL_STAGES(_cycler) {
-    CDStageWriter cdata(_cycler, pipeline_stage);
-    mark_internal_bounds_stale(cdata);
-  }
-  CLOSE_ITERATE_ALL_STAGES(_cycler);
-}
-
 /**
  *
  */

+ 2 - 1
panda/src/gobj/geom.h

@@ -62,10 +62,11 @@ protected:
   Geom(const Geom &copy);
 
 PUBLISHED:
-  void operator = (const Geom &copy);
   virtual ~Geom();
   ALLOC_DELETED_CHAIN(Geom);
 
+  void operator = (const Geom &copy) = delete;
+
   virtual Geom *make_copy() const;
 
   INLINE PrimitiveType get_primitive_type() const;

+ 0 - 11
panda/src/gobj/geomPrimitive.cxx

@@ -77,17 +77,6 @@ GeomPrimitive(const GeomPrimitive &copy) :
 {
 }
 
-/**
- * The copy assignment operator is not pipeline-safe.  This will completely
- * obliterate all stages of the pipeline, so don't do it for a GeomPrimitive
- * that is actively being used for rendering.
- */
-void GeomPrimitive::
-operator = (const GeomPrimitive &copy) {
-  CopyOnWriteObject::operator = (copy);
-  _cycler = copy._cycler;
-}
-
 /**
  *
  */

+ 2 - 1
panda/src/gobj/geomPrimitive.h

@@ -61,10 +61,11 @@ protected:
 PUBLISHED:
   explicit GeomPrimitive(UsageHint usage_hint);
   GeomPrimitive(const GeomPrimitive &copy);
-  void operator = (const GeomPrimitive &copy);
   virtual ~GeomPrimitive();
   ALLOC_DELETED_CHAIN(GeomPrimitive);
 
+  void operator = (const GeomPrimitive &copy) = delete;
+
   virtual PT(GeomPrimitive) make_copy() const=0;
 
   virtual PrimitiveType get_primitive_type() const=0;

+ 0 - 24
panda/src/gobj/geomVertexArrayData.cxx

@@ -107,30 +107,6 @@ GeomVertexArrayData(const GeomVertexArrayData &copy) :
   nassertv(_array_format->is_registered());
 }
 
-/**
- * The copy assignment operator is not pipeline-safe.  This will completely
- * obliterate all stages of the pipeline, so don't do it for a
- * GeomVertexArrayData that is actively being used for rendering.
- */
-void GeomVertexArrayData::
-operator = (const GeomVertexArrayData &copy) {
-  CopyOnWriteObject::operator = (copy);
-  SimpleLruPage::operator = (copy);
-
-  copy.mark_used_lru();
-
-  _array_format = copy._array_format;
-  _cycler = copy._cycler;
-
-  OPEN_ITERATE_ALL_STAGES(_cycler) {
-    CDStageWriter cdata(_cycler, pipeline_stage);
-    cdata->_modified = Geom::get_next_modified();
-  }
-  CLOSE_ITERATE_ALL_STAGES(_cycler);
-
-  nassertv(_array_format->is_registered());
-}
-
 /**
  *
  */

+ 2 - 1
panda/src/gobj/geomVertexArrayData.h

@@ -66,10 +66,11 @@ PUBLISHED:
   explicit GeomVertexArrayData(const GeomVertexArrayFormat *array_format,
                                UsageHint usage_hint);
   GeomVertexArrayData(const GeomVertexArrayData &copy);
-  void operator = (const GeomVertexArrayData &copy);
   virtual ~GeomVertexArrayData();
   ALLOC_DELETED_CHAIN(GeomVertexArrayData);
 
+  void operator = (const GeomVertexArrayData &copy) = delete;
+
   int compare_to(const GeomVertexArrayData &other) const;
 
   INLINE const GeomVertexArrayFormat *get_array_format() const;

+ 0 - 27
panda/src/gobj/geomVertexData.cxx

@@ -136,33 +136,6 @@ GeomVertexData(const GeomVertexData &copy,
   CLOSE_ITERATE_ALL_STAGES(_cycler);
 }
 
-/**
- * The copy assignment operator is not pipeline-safe.  This will completely
- * obliterate all stages of the pipeline, so don't do it for a GeomVertexData
- * that is actively being used for rendering.
- */
-void GeomVertexData::
-operator = (const GeomVertexData &copy) {
-  CopyOnWriteObject::operator = (copy);
-
-  clear_cache();
-
-  _name = copy._name;
-  _cycler = copy._cycler;
-  _char_pcollector = copy._char_pcollector;
-  _skinning_pcollector = copy._skinning_pcollector;
-  _morphs_pcollector = copy._morphs_pcollector;
-  _blends_pcollector = copy._blends_pcollector;
-
-  OPEN_ITERATE_ALL_STAGES(_cycler) {
-    CDStageWriter cdata(_cycler, pipeline_stage);
-    cdata->_modified = Geom::get_next_modified();
-    cdata->_animated_vertices = nullptr;
-    cdata->_animated_vertices_modified = UpdateSeq();
-  }
-  CLOSE_ITERATE_ALL_STAGES(_cycler);
-}
-
 /**
  *
  */

+ 2 - 1
panda/src/gobj/geomVertexData.h

@@ -78,10 +78,11 @@ PUBLISHED:
   GeomVertexData(const GeomVertexData &copy);
   explicit GeomVertexData(const GeomVertexData &copy,
                           const GeomVertexFormat *format);
-  void operator = (const GeomVertexData &copy);
   virtual ~GeomVertexData();
   ALLOC_DELETED_CHAIN(GeomVertexData);
 
+  void operator = (const GeomVertexData &copy) = delete;
+
   int compare_to(const GeomVertexData &other) const;
 
   INLINE const std::string &get_name() const;

+ 0 - 9
panda/src/text/geomTextGlyph.cxx

@@ -67,15 +67,6 @@ GeomTextGlyph(const Geom &copy, const TextGlyph *glyph) :
   }
 }
 
-/**
- *
- */
-void GeomTextGlyph::
-operator = (const GeomTextGlyph &copy) {
-  Geom::operator = (copy);
-  _glyphs = copy._glyphs;
-}
-
 /**
  *
  */

+ 2 - 1
panda/src/text/geomTextGlyph.h

@@ -30,10 +30,11 @@ public:
   GeomTextGlyph(const GeomVertexData *data);
   GeomTextGlyph(const GeomTextGlyph &copy);
   GeomTextGlyph(const Geom &copy, const TextGlyph *glyph);
-  void operator = (const GeomTextGlyph &copy);
   virtual ~GeomTextGlyph();
   ALLOC_DELETED_CHAIN(GeomTextGlyph);
 
+  void operator = (const GeomTextGlyph &copy) = delete;
+
   virtual Geom *make_copy() const;
   virtual bool copy_primitives_from(const Geom *other);
   void count_geom(const Geom *other);