@@ -296,6 +296,13 @@ class RGeomDescription {
296296
297297 int IsPhysNodeVisible (const std::vector<int > &stack);
298298
299+ /* * clear drawing data without locking mutex */
300+ void _ClearDrawData ()
301+ {
302+ fDrawJson .clear ();
303+ fSearchJson .clear ();
304+ }
305+
299306public:
300307 RGeomDescription () = default ;
301308
@@ -311,51 +318,131 @@ public:
311318 TVirtualMutex *GetMutex () const { return fMutex ; }
312319
313320 /* * Set maximal number of nodes which should be selected for drawing */
314- void SetMaxVisNodes (int cnt) { TLockGuard lock (fMutex ); fCfg .maxnumnodes = cnt; }
321+ void SetMaxVisNodes (int cnt)
322+ {
323+ TLockGuard lock (fMutex );
324+ fCfg .maxnumnodes = cnt;
325+ _ClearDrawData ();
326+ }
315327 /* * Returns maximal visible number of nodes, ignored when non-positive */
316- int GetMaxVisNodes () const { TLockGuard lock (fMutex ); return fCfg .maxnumnodes ; }
328+ int GetMaxVisNodes () const
329+ {
330+ TLockGuard lock (fMutex );
331+ return fCfg .maxnumnodes ;
332+ }
317333
318334 /* * Set maximal number of faces which should be selected for drawing */
319- void SetMaxVisFaces (int cnt) { TLockGuard lock (fMutex ); fCfg .maxnumfaces = cnt; }
335+ void SetMaxVisFaces (int cnt)
336+ {
337+ TLockGuard lock (fMutex );
338+ fCfg .maxnumfaces = cnt;
339+ _ClearDrawData ();
340+ }
320341 /* * Returns maximal visible number of faces, ignored when non-positive */
321- int GetMaxVisFaces () const { TLockGuard lock (fMutex ); return fCfg .maxnumfaces ; }
342+ int GetMaxVisFaces () const
343+ {
344+ TLockGuard lock (fMutex );
345+ return fCfg .maxnumfaces ;
346+ }
322347
323348 /* * Set maximal visible level */
324- void SetVisLevel (int lvl = 3 ) { TLockGuard lock (fMutex ); fCfg .vislevel = lvl; }
349+ void SetVisLevel (int lvl = 3 )
350+ {
351+ TLockGuard lock (fMutex );
352+ fCfg .vislevel = lvl;
353+ _ClearDrawData ();
354+ }
325355 /* * Returns maximal visible level */
326- int GetVisLevel () const { TLockGuard lock (fMutex ); return fCfg .vislevel ; }
356+ int GetVisLevel () const
357+ {
358+ TLockGuard lock (fMutex );
359+ return fCfg .vislevel ;
360+ }
327361
328362 /* * Set draw options as string for JSROOT TGeoPainter */
329- void SetTopVisible (bool on = true ) { TLockGuard lock (fMutex ); fCfg .showtop = on; }
363+ void SetTopVisible (bool on = true )
364+ {
365+ TLockGuard lock (fMutex );
366+ fCfg .showtop = on;
367+ _ClearDrawData ();
368+ }
330369 /* * Returns draw options, used for JSROOT TGeoPainter */
331- bool GetTopVisible () const { TLockGuard lock (fMutex ); return fCfg .showtop ; }
370+ bool GetTopVisible () const
371+ {
372+ TLockGuard lock (fMutex );
373+ return fCfg .showtop ;
374+ }
332375
333376 /* * Instruct to build binary 3D model already on the server (true) or send TGeoShape as is to client, which can build model itself */
334- void SetBuildShapes (int lvl = 1 ) { TLockGuard lock (fMutex ); fCfg .build_shapes = lvl; }
377+ void SetBuildShapes (int lvl = 1 )
378+ {
379+ TLockGuard lock (fMutex );
380+ fCfg .build_shapes = lvl;
381+ _ClearDrawData ();
382+ }
335383 /* * Returns true if binary 3D model build already by C++ server (default) */
336- int IsBuildShapes () const { TLockGuard lock (fMutex ); return fCfg .build_shapes ; }
384+ int IsBuildShapes () const
385+ {
386+ TLockGuard lock (fMutex );
387+ return fCfg .build_shapes ;
388+ }
337389
338390 /* * Set number of segments for cylindrical shapes, if 0 - default value will be used */
339- void SetNSegments (int n = 0 ) { TLockGuard lock (fMutex ); fCfg .nsegm = n; }
391+ void SetNSegments (int n = 0 )
392+ {
393+ TLockGuard lock (fMutex );
394+ fCfg .nsegm = n;
395+ _ClearDrawData ();
396+ }
340397 /* * Return of segments for cylindrical shapes, if 0 - default value will be used */
341- int GetNSegments () const { TLockGuard lock (fMutex ); return fCfg .nsegm ; }
398+ int GetNSegments () const
399+ {
400+ TLockGuard lock (fMutex );
401+ return fCfg .nsegm ;
402+ }
342403
343404 /* * Set draw options as string for JSROOT TGeoPainter */
344- void SetDrawOptions (const std::string &opt = " " ) { TLockGuard lock (fMutex ); fCfg .drawopt = opt; }
405+ void SetDrawOptions (const std::string &opt = " " )
406+ {
407+ TLockGuard lock (fMutex );
408+ fCfg .drawopt = opt;
409+ _ClearDrawData ();
410+ }
345411 /* * Returns draw options, used for JSROOT TGeoPainter */
346- std::string GetDrawOptions () const { TLockGuard lock (fMutex ); return fCfg .drawopt ; }
412+ std::string GetDrawOptions () const
413+ {
414+ TLockGuard lock (fMutex );
415+ return fCfg .drawopt ;
416+ }
347417
348418 /* * Set JSON compression level for data transfer */
349- void SetJsonComp (int comp = 0 ) { TLockGuard lock (fMutex ); fJsonComp = comp; }
419+ void SetJsonComp (int comp = 0 )
420+ {
421+ TLockGuard lock (fMutex );
422+ fJsonComp = comp;
423+ _ClearDrawData ();
424+ }
350425 /* * Returns JSON compression level for data transfer */
351- int GetJsonComp () const { TLockGuard lock (fMutex ); return fJsonComp ; }
426+ int GetJsonComp () const
427+ {
428+ TLockGuard lock (fMutex );
429+ return fJsonComp ;
430+ }
352431
353432 /* * Set preference of offline operations.
354433 * Server provides more info to client from the begin on to avoid communication */
355- void SetPreferredOffline (bool on) { TLockGuard lock (fMutex ); fPreferredOffline = on; }
434+ void SetPreferredOffline (bool on)
435+ {
436+ TLockGuard lock (fMutex );
437+ fPreferredOffline = on;
438+ }
356439 /* * Is offline operations preferred.
357440 * After get full description, client can do most operations without extra requests */
358- bool IsPreferredOffline () const { TLockGuard lock (fMutex ); return fPreferredOffline ; }
441+ bool IsPreferredOffline () const
442+ {
443+ TLockGuard lock (fMutex );
444+ return fPreferredOffline ;
445+ }
359446
360447 /* * Get top node path */
361448 const std::vector<int >& GetSelectedStack () const { return fSelectedStack ; }
0 commit comments