Version: 6.3.1

src/VISU_I/VISU_PointMap3d_i.hh

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  VISU OBJECT : interactive object for VISU entities implementation
00021 //  File   : VISU_PointMap3d_i.hh
00022 //  Author : 
00023 //  Module : VISU
00024 //
00025 #ifndef VISU_PointMap3d_i_HeaderFile
00026 #define VISU_PointMap3d_i_HeaderFile
00027 
00028 #include "VISU_PrsObject_i.hh"
00029 #include "SALOME_GenericObj_i.hh"
00030 
00031 #include "VISU_TableReader.hxx"
00032 #include "VISU_PointMap3dActor.h"
00033 #include "VISU_Table_i.hh"
00034 #include "VISU_ActorFactory.h"
00035 #include "VISU_DeformedGridPL.hxx"
00036 
00037 #include <vtkTimeStamp.h>
00038 #include <vtkSmartPointer.h>
00039 
00040 namespace VISU
00041 {
00042 
00043   struct TActorFactory;
00044 
00045   //==============================================================================
00046   class VISU_I_EXPORT PointMap3d_i : public virtual POA_VISU::PointMap3d,
00047                          public virtual SALOME::GenericObj_i,
00048                          public virtual TActorFactory,
00049                          public virtual Table_i
00050   {
00051     static int myNbPresent;
00052     PointMap3d_i( const PointMap3d_i& );
00053   public:
00054     PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry);
00055 
00056     virtual ~PointMap3d_i();
00057     virtual VISU::VISUType GetType() { return VISU::TPOINTMAP3D;};
00058 
00059     virtual void SetTitle( const char* theTitle );
00060     virtual char* GetTitle();
00061 
00062     virtual void RemoveFromStudy();
00063     virtual void UpdateActor(VISU_ActorBase* thePointMap3dActor);
00064     virtual void UpdateActors();
00065 
00066     virtual void Update();
00067 
00068     virtual Handle(SALOME_InteractiveObject) GetIO();
00069 
00070     //----------- override Prs3d methods -----------------------------
00071 
00073     virtual void SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz);
00074 
00076     virtual void GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz);
00077 
00079     virtual void SetMarkerStd(VISU::MarkerType, VISU::MarkerScale);
00080     virtual void SetMarkerTexture(CORBA::Long);
00081     virtual VISU::MarkerType GetMarkerType();
00082     virtual VISU::MarkerScale GetMarkerScale();
00083     virtual CORBA::Long GetMarkerTexture();
00084 
00086     virtual CORBA::Float GetMemorySize();
00087 
00088     //----------- override ColoredPrs3dBase methods ------------------
00089 
00090     virtual CORBA::Double GetMin();
00091     virtual CORBA::Double GetMax();
00092     virtual CORBA::Double GetMinTableValue();
00093     virtual CORBA::Double GetMaxTableValue();
00094     virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
00095 
00096     virtual CORBA::Double GetSourceMin();
00097     virtual CORBA::Double GetSourceMax();
00098     virtual void SetSourceRange();
00099 
00100     virtual CORBA::Boolean IsRangeFixed();
00101 
00102     virtual void SetPosition(CORBA::Double X, CORBA::Double Y);
00103     virtual CORBA::Double GetPosX();
00104     virtual CORBA::Double GetPosY();
00105 
00106     virtual void SetSize(CORBA::Double theWidth, CORBA::Double theHeight);
00107 
00108     virtual void SetRatios(CORBA::Long theTitleSize, CORBA::Long theLabelSize, 
00109                   CORBA::Long theBarWidth, CORBA::Long theBarHeight);
00110 
00111     virtual CORBA::Double GetWidth();
00112     virtual CORBA::Double GetHeight();
00113 
00114     virtual void SetNbColors(CORBA::Long theNbColors);
00115     virtual CORBA::Long GetNbColors();
00116 
00117     virtual void SetLabels(CORBA::Long theNbLabels);
00118     virtual CORBA::Long GetLabels();
00119 
00120     virtual void  SetLabelsFormat(const char* theFormat);
00121     virtual char* GetLabelsFormat();
00122     
00123     virtual void SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theOrientation);
00124     virtual VISU::ColoredPrs3dBase::Orientation GetBarOrientation();
00125 
00126     void UseFixedRange(bool theUseFixedRange);
00127 
00128     // ScaledMap Methods
00129 
00130     virtual VISU::Scaling GetScaling();
00131     virtual void SetScaling(VISU::Scaling theScaling);
00132 
00133     bool IsPositiveTable();
00134 
00135     // Plot3dBase methods
00136 
00137     void SetScaleFactor (CORBA::Double theScaleFactor);
00138     CORBA::Double GetScaleFactor();
00139 
00140     void SetContourPrs (CORBA::Boolean theIsContourPrs );
00141     CORBA::Boolean GetIsContourPrs();
00142 
00143     void SetNbOfContours (CORBA::Long);
00144     CORBA::Long GetNbOfContours();
00145 
00146     VISU_DeformedGridPL* GetSpecificPL() const { return myTablePL; }
00147 
00148     // TActorFactory Methods
00149 
00151     virtual bool GetActiveState();
00152 
00153     virtual void SetActiveState(bool theState);
00154 
00156     virtual unsigned long int GetMTime();
00157 
00159     virtual void RemoveActor(VISU_ActorBase* theActor);
00160     virtual void RemoveActors();
00161 
00162     //------ Text Properties & Label Properties ------------------------
00163 
00164     virtual bool IsBoldTitle();
00165     virtual void SetBoldTitle(bool isBold);
00166     virtual bool IsItalicTitle();
00167     virtual void SetItalicTitle(bool isItalic);
00168     virtual bool IsShadowTitle();
00169     virtual void SetShadowTitle(bool isShadow);
00170     virtual int  GetTitFontType();
00171     virtual void SetTitFontType(int theType);
00172     virtual void GetTitleColor(vtkFloatingPointType& theR, 
00173            vtkFloatingPointType& theG, 
00174            vtkFloatingPointType& theB);
00175     virtual void SetTitleColor(vtkFloatingPointType theR, 
00176            vtkFloatingPointType theG, 
00177            vtkFloatingPointType theB);    
00178 
00179     virtual bool IsBoldLabel();
00180     virtual void SetBoldLabel(bool isBold);
00181     virtual bool IsItalicLabel();
00182     virtual void SetItalicLabel(bool isItalic);
00183     virtual bool IsShadowLabel();
00184     virtual void SetShadowLabel(bool isShadow);
00185     virtual int  GetLblFontType();
00186     virtual void SetLblFontType(int theType);
00187     virtual void GetLabelColor(vtkFloatingPointType& theR, 
00188            vtkFloatingPointType& theG, 
00189            vtkFloatingPointType& theB);
00190     virtual void SetLabelColor(vtkFloatingPointType theR, 
00191            vtkFloatingPointType theG, 
00192            vtkFloatingPointType theB);
00193 
00194     //-------------------------------------------------------------------
00195     virtual CORBA::Long GetTitleSize();
00196     virtual CORBA::Long GetLabelSize();
00197     virtual CORBA::Long GetBarWidth();
00198     virtual CORBA::Long GetBarHeight();
00199 
00200     virtual void SetUnitsVisible(CORBA::Boolean isVisible);
00201     virtual CORBA::Boolean IsUnitsVisible();
00202 
00203     //-------------------------------------------------------------------
00204 
00205   protected:
00206     Storable* Build(int theRestoring);
00207 
00208     VISU::Table::Orientation myOrientation;
00209     VISU::ColoredPrs3dBase::Orientation myBarOrientation;
00210     std::string              myTitle;
00211     std::string              myScalarBarTitle;
00212     bool                     myIsUnits;
00213     SALOMEDS::SObject_var    mySObj;
00214     int                      myNumberOfLabels;
00215     std::string              myLabelsFormat;
00216     vtkFloatingPointType     myPosition[2],
00217                              myWidth, myHeight,
00218                              myTitleSize,
00219                              myLabelSize, 
00220                              myBarWidth, myBarHeight;
00221     bool                     myIsFixedRange;
00222     CORBA::Float             myOffset[3];
00223     bool                     myIsActiveState;
00224     vtkTimeStamp             myParamsTime;
00225     vtkTimeStamp             myUpdateTime;
00226 
00227     Handle(SALOME_InteractiveObject) myIO;
00228 
00229 
00230     //Font management
00231     bool myIsBoldTitle;
00232     bool myIsItalicTitle;
00233     bool myIsShadowTitle;
00234     int  myTitFontType;
00235     vtkFloatingPointType myTitleColor[3];
00236 
00237     bool myIsBoldLabel;
00238     bool myIsItalicLabel;
00239     bool myIsShadowLabel;
00240     int  myLblFontType;
00241     vtkFloatingPointType myLabelColor[3];
00242 
00243     boost::signal0<void> myUpdateActorsSignal;
00244     boost::signal0<void> myRemoveActorsFromRendererSignal;
00245     vtkSmartPointer<vtkActorCollection> myActorCollection;
00246 
00247   public:
00248     //    virtual Storable* Create( const VISU::PTableIDMapper& theTableIDMapper );
00249     virtual Storable*       Create();
00250     VISU_PointMap3dActor*   CreateActor();
00251     VISU::PTableIDMapper    GetTableIDMapper();
00252 
00253     SALOMEDS::SObject_var GetSObject() const;
00254     VISU_DeformedGridPL*  myTablePL;
00255 
00256     virtual Storable* Restore( const Storable::TRestoringMap& theMap,
00257                       SALOMEDS::SObject_ptr SO);
00258 
00259     static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
00260                         const Storable::TRestoringMap& theMap,
00261                         const std::string& thePrefix,
00262                         CORBA::Boolean theIsMultiFile);
00263 
00264     virtual void ToStream( std::ostringstream& theStr );
00265     static const std::string myComment;
00266     virtual const char* GetComment() const;
00267     virtual QString GenerateName();
00268     virtual QString GetTableTitle();
00269 
00270     virtual std::string GetObjectEntry();
00271   };
00272 }
00273 
00274 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS