Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Servers/ServerManager/vtkSMPropertyAdaptor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkSMPropertyAdaptor.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00024 #ifndef __vtkSMPropertyAdaptor_h
00025 #define __vtkSMPropertyAdaptor_h
00026 
00027 #include "vtkSMObject.h"
00028 
00029 class vtkSMDomain;
00030 class vtkSMBooleanDomain;
00031 class vtkSMDoubleRangeDomain;
00032 class vtkSMEnumerationDomain;
00033 class vtkSMIntRangeDomain;
00034 class vtkSMProxyGroupDomain;
00035 class vtkSMStringListDomain;
00036 class vtkSMStringListRangeDomain;
00037 
00038 class vtkSMProperty;
00039 class vtkSMProxyProperty;
00040 class vtkSMDoubleVectorProperty;
00041 class vtkSMIdTypeVectorProperty;
00042 class vtkSMIntVectorProperty;
00043 class vtkSMStringVectorProperty;
00044 
00045 class VTK_EXPORT vtkSMPropertyAdaptor : public vtkSMObject
00046 {
00047 public:
00048   static vtkSMPropertyAdaptor* New();
00049   vtkTypeRevisionMacro(vtkSMPropertyAdaptor, vtkSMObject);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053 
00055   void SetProperty(vtkSMProperty* prop);
00056   vtkGetObjectMacro(Property, vtkSMProperty);
00058 
00059   // ----------------------------------------------------
00060   // Vector properties (int and double) with range
00061 
00063   const char* GetRangeMinimum(unsigned int idx);
00064   const char* GetRangeMaximum(unsigned int idx);
00066 
00067   unsigned int GetNumberOfRangeElements();
00068 
00069   const char* GetRangeValue(unsigned int idx);
00070 
00071   int SetRangeValue(unsigned int idx, const char* value);
00072 
00073   // ----------------------------------------------------
00074   // Enumeration properties
00075 
00076   unsigned int GetNumberOfEnumerationElements();
00077 
00078   const char* GetEnumerationName(unsigned int idx);
00079 
00080   const char* GetEnumerationValue();
00081 
00082   int SetEnumerationValue(const char* idx);
00083 
00084   // ----------------------------------------------------
00085   // Selection properties
00086 
00087   unsigned int GetNumberOfSelectionElements();
00088 
00089   const char* GetSelectionName(unsigned int idx);
00090 
00091   const char* GetSelectionValue(unsigned int idx);
00092 
00093   int SetSelectionValue(unsigned int idx, const char* value);
00094 
00096   const char* GetSelectionMinimum(unsigned int idx);
00097   const char* GetSelectionMaximum(unsigned int idx);
00099 
00100   // ----------------------------------------------------
00101   // General
00102 
00103   void InitializePropertyFromInformation();
00104 
00106   int GetPropertyType();
00107 
00109   int GetElementType();
00110 
00111   int SetGenericValue(unsigned int idx, const char* value);
00112 
00113 //BTX
00114   enum PropertyTypes
00115   {
00116     UNKNOWN = 0,
00117     ENUMERATION,
00118     SELECTION,
00119     RANGE
00120   };
00121 
00122   enum ElementType
00123   {
00124     INT = RANGE + 1,
00125     DOUBLE,
00126     STRING,
00127     BOOLEAN,
00128     PROXY
00129   };
00130 //ETX
00131 
00132 protected:
00133   vtkSMPropertyAdaptor();
00134   ~vtkSMPropertyAdaptor();
00135 
00136   void InitializeDomains();
00137   void InitializeProperties();
00138 
00139   void SetDomain(vtkSMDomain* domain);
00140 
00141   vtkSMBooleanDomain* BooleanDomain;
00142   vtkSMDoubleRangeDomain* DoubleRangeDomain;
00143   vtkSMEnumerationDomain* EnumerationDomain;
00144   vtkSMIntRangeDomain* IntRangeDomain;
00145   vtkSMProxyGroupDomain* ProxyGroupDomain;
00146   vtkSMStringListDomain* StringListDomain;
00147   vtkSMStringListRangeDomain* StringListRangeDomain;
00148 
00149   vtkSMProxyProperty* ProxyProperty;
00150   vtkSMDoubleVectorProperty* DoubleVectorProperty;
00151   vtkSMIdTypeVectorProperty* IdTypeVectorProperty;
00152   vtkSMIntVectorProperty* IntVectorProperty;
00153   vtkSMStringVectorProperty* StringVectorProperty;
00154 
00155   vtkSMProperty* Property;
00156 
00157   char Minimum[128];
00158   char Maximum[128];
00159   char EnumValue[128];
00160   char ElemValue[128];
00161 
00162   virtual void SaveState(const char*, ostream*, vtkIndent) {}
00163 
00164 private:
00165   vtkSMPropertyAdaptor(const vtkSMPropertyAdaptor&); // Not implemented
00166   void operator=(const vtkSMPropertyAdaptor&); // Not implemented
00167 };
00168 
00169 #endif

Generated on Tue May 30 12:31:48 2006 for ParaView by doxygen 1.3.5