1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // VISU OBJECT : interactive object for VISU entities implementation
21 // File : VISU_Prs3dUtils.cc
22 // Author : Alexey PETROV
25 #include "VISU_Prs3dUtils.hh"
26 #include "SalomeApp_Study.h"
27 #include "SALOME_Event.h"
32 //----------------------------------------------------------------------------
34 ::TSetModified(VISU::Prs3d_i* thePrs3d):
41 //----------------------------------------------------------------------------
45 struct TEvent: public SALOME_Event
47 VISU::TSetModified* mySetModified;
48 TEvent(VISU::TSetModified* theSetModified):
49 mySetModified(theSetModified)
56 VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d;
58 if(!aPrs3d || aPrs3d->GetActorEntry() == "")
61 if(aPrs3d->GetMTime() > mySetModified->GetMTime()){
62 if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy())
68 ProcessVoidEvent(new TEvent(this));
71 //----------------------------------------------------------------------------
73 std::string ToFormat( const int thePrec )
77 sprintf( str, "%%-#.%dg", thePrec );
81 //----------------------------------------------------------------------------
83 int ToPrecision( const char* theFormat )
85 int N = strlen( theFormat );
89 for ( int i = 0; i < N; i++ )
91 if ( theFormat[ i ] == '.' )
93 else if ( theFormat[ i ] == 'g' )
100 str[ k++ ] = theFormat[ i ];