00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkPVLineWidget_h
00026 #define __vtkPVLineWidget_h
00027
00028 #include "vtkPV3DWidget.h"
00029
00030 class vtkKWEntry;
00031 class vtkKWLabel;
00032
00033 class VTK_EXPORT vtkPVLineWidget : public vtkPV3DWidget
00034 {
00035 public:
00036 static vtkPVLineWidget* New();
00037 vtkTypeRevisionMacro(vtkPVLineWidget, vtkPV3DWidget);
00038 void PrintSelf(ostream& os, vtkIndent indent);
00039
00042 virtual void Create(vtkKWApplication* app);
00043
00045
00047 void SetPoint1();
00048 void SetPoint2();
00049 void SetPoint1(double x, double y, double z);
00050 void SetPoint2(double x, double y, double z);
00051 void GetPoint1(double pt[3]);
00052 void GetPoint2(double pt[3]);
00054
00056
00057 void SetResolution();
00058 void SetResolution(int f);
00059 int GetResolution();
00061
00063
00064 void SetPoint1VariableName(const char* varname);
00065 void SetPoint2VariableName(const char* varname);
00066 void SetResolutionVariableName(const char* varname);
00068
00069 vtkGetStringMacro(Point1Variable);
00070 vtkGetStringMacro(Point2Variable);
00071 vtkGetStringMacro(ResolutionVariable);
00072
00074
00075 void SetPoint1LabelTextName(const char* varname);
00076 void SetPoint2LabelTextName(const char* varname);
00077 void SetResolutionLabelTextName(const char* varname);
00079
00081
00082 vtkGetStringMacro(Point1LabelText);
00083 vtkGetStringMacro(Point2LabelText);
00084 vtkGetStringMacro(ResolutionLabelText);
00086
00088
00089 vtkGetMacro(ShowResolution, int);
00090 vtkSetMacro(ShowResolution, int);
00091 vtkBooleanMacro(ShowResolution, int);
00093
00098 virtual void ActualPlaceWidget();
00099
00100
00102
00105 vtkPVLineWidget* ClonePrototype(vtkPVSource* pvSource,
00106 vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
00108
00109
00112 virtual void SetBalloonHelpString(const char *str);
00113
00114
00116
00118 virtual void Accept();
00119
00121
00123 virtual void Initialize();
00124
00128 virtual void ResetInternal();
00129
00131 virtual void Trace(ofstream *file);
00132
00139 virtual void UpdateEnableState();
00140
00142 virtual void SaveInBatchScript(ofstream *file);
00143
00144 protected:
00145 vtkPVLineWidget();
00146 ~vtkPVLineWidget();
00147
00148
00149
00150 virtual void CopyProperties(vtkPVWidget* clone, vtkPVSource* pvSource,
00151 vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
00152
00153 friend class vtkLineWidgetObserver;
00154
00155
00156 int ReadXMLAttributes(vtkPVXMLElement* element,
00157 vtkPVXMLPackageParser* parser);
00158
00160 virtual void ChildCreate(vtkPVApplication*);
00161
00163 virtual void ExecuteEvent(vtkObject*, unsigned long, void*);
00164
00165
00166
00167 void SetPoint1Internal(double x, double y, double z);
00168 void SetPoint2Internal(double x, double y, double z);
00169 void SetResolutionInternal(int res);
00170
00172
00174 void GetPoint1Internal(double pt[3]);
00175 void GetPoint2Internal(double pt[3]);
00176 int GetResolutionInternal();
00178
00179 void DisplayLength(double len);
00180
00181 vtkKWEntry* Point1[3];
00182 vtkKWEntry* Point2[3];
00183 vtkKWLabel* Labels[2];
00184 vtkKWLabel* CoordinateLabel[3];
00185 vtkKWLabel* ResolutionLabel;
00186 vtkKWEntry* ResolutionEntry;
00187 vtkKWLabel* LengthLabel;
00188 vtkKWLabel* LengthValue;
00189
00190 vtkSetStringMacro(Point1Variable);
00191 vtkSetStringMacro(Point2Variable);
00192 vtkSetStringMacro(ResolutionVariable);
00193
00194 char *Point1Variable;
00195 char *Point2Variable;
00196 char *ResolutionVariable;
00197
00198 vtkSetStringMacro(Point1LabelText);
00199 vtkSetStringMacro(Point2LabelText);
00200 vtkSetStringMacro(ResolutionLabelText);
00201
00202 char *Point1LabelText;
00203 char *Point2LabelText;
00204 char *ResolutionLabelText;
00205
00206 int ShowResolution;
00207
00208 private:
00209 vtkPVLineWidget(const vtkPVLineWidget&);
00210 void operator=(const vtkPVLineWidget&);
00211 };
00212
00213 #endif