@@ -53,6 +53,29 @@ void GLModelList::clear()
5353 this ->glIsoList .clear ();
5454}
5555
56+ void GLModelList::invalidateAll ()
57+ {
58+ auto invalidateVector = [](QVector<GLEntityList> &v)
59+ {
60+ for (GLEntityList &list : v)
61+ {
62+ for (GLuint i = 0 ; i < GL_ENTITY_LIST_ITEM_N_LISTS; i++)
63+ {
64+ list.setListInvalid (i);
65+ }
66+ }
67+ };
68+ invalidateVector (this ->glPointList );
69+ invalidateVector (this ->glLineList );
70+ invalidateVector (this ->glSurfaceList );
71+ invalidateVector (this ->glVolumeList );
72+ invalidateVector (this ->glVectorFieldList );
73+ invalidateVector (this ->glScalarFieldList );
74+ invalidateVector (this ->glStreamLineList );
75+ invalidateVector (this ->glCutList );
76+ invalidateVector (this ->glIsoList );
77+ }
78+
5679uint GLModelList::getNGlPointLists () const
5780{
5881 return uint (this ->glPointList .size ());
@@ -62,7 +85,6 @@ void GLModelList::setNGlPointLists(uint nGlEntityLists)
6285{
6386 if (this ->glPointList .size () != int (nGlEntityLists))
6487 {
65- this ->glPointList .clear ();
6688 this ->glPointList .resize (GLsizei (nGlEntityLists));
6789 }
6890}
@@ -94,7 +116,6 @@ void GLModelList::setNGlLineLists(uint nGlEntityLists)
94116{
95117 if (this ->glLineList .size () != int (nGlEntityLists))
96118 {
97- this ->glLineList .clear ();
98119 this ->glLineList .resize (GLsizei (nGlEntityLists));
99120 }
100121}
@@ -126,7 +147,6 @@ void GLModelList::setNGlSurfaceLists(uint nGlEntityLists)
126147{
127148 if (this ->glSurfaceList .size () != int (nGlEntityLists))
128149 {
129- this ->glSurfaceList .clear ();
130150 this ->glSurfaceList .resize (GLsizei (nGlEntityLists));
131151 }
132152}
@@ -158,7 +178,6 @@ void GLModelList::setNGlVolumeLists(uint nGlEntityLists)
158178{
159179 if (this ->glVolumeList .size () != int (nGlEntityLists))
160180 {
161- this ->glVolumeList .clear ();
162181 this ->glVolumeList .resize (GLsizei (nGlEntityLists));
163182 }
164183}
@@ -190,7 +209,6 @@ void GLModelList::setNGlVectorFieldLists(uint nGlEntityLists)
190209{
191210 if (this ->glVectorFieldList .size () != int (nGlEntityLists))
192211 {
193- this ->glVectorFieldList .clear ();
194212 this ->glVectorFieldList .resize (GLsizei (nGlEntityLists));
195213 }
196214}
@@ -222,7 +240,6 @@ void GLModelList::setNGlScalarFieldLists(uint nGlEntityLists)
222240{
223241 if (this ->glScalarFieldList .size () != int (nGlEntityLists))
224242 {
225- this ->glScalarFieldList .clear ();
226243 this ->glScalarFieldList .resize (GLsizei (nGlEntityLists));
227244 }
228245}
@@ -254,7 +271,6 @@ void GLModelList::setNGlStreamLineLists(uint nGlEntityLists)
254271{
255272 if (this ->glStreamLineList .size () != int (nGlEntityLists))
256273 {
257- this ->glStreamLineList .clear ();
258274 this ->glStreamLineList .resize (GLsizei (nGlEntityLists));
259275 }
260276}
@@ -286,7 +302,6 @@ void GLModelList::setNGlCutLists(uint nGlEntityLists)
286302{
287303 if (this ->glCutList .size () != int (nGlEntityLists))
288304 {
289- this ->glCutList .clear ();
290305 this ->glCutList .resize (GLsizei (nGlEntityLists));
291306 }
292307}
@@ -318,7 +333,6 @@ void GLModelList::setNGlIsoLists(uint nGlEntityLists)
318333{
319334 if (this ->glIsoList .size () != int (nGlEntityLists))
320335 {
321- this ->glIsoList .clear ();
322336 this ->glIsoList .resize (GLsizei (nGlEntityLists));
323337 }
324338}
0 commit comments