00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __vtkCard_h
00030 #define __vtkCard_h
00031
00032
00033 #include "vtkObject.h"
00034 #include "vtkTexture.h"
00035 #include "vtkFollower.h"
00036 #include "vtkCollection.h"
00037 #include "vtkRenderer.h"
00038
00039 #include "simpleVectors.h"
00040
00041 #include "vtkQueryAtlasWin32Header.h"
00042
00043
00044 class vtkTextureText;
00045 class vtkFollower;
00046 class vtkRectangle;
00047 class vtkCamera;
00048 class vtkActor;
00049 class vtkLineSource;
00050
00051
00052 #define VTK_TEXT_CARD_EDGE_COUNT (8)
00053
00054
00055 class VTK_QUERYATLAS_EXPORT vtkCard : public vtkObject
00056 {
00057 public:
00058 void PrintSelf(ostream& os, vtkIndent indent);
00059 vtkTypeRevisionMacro(vtkCard,vtkObject);
00060
00061
00062
00063 static vtkCard *New();
00064
00065 vtkGetObjectMacro(MainText, vtkTextureText);
00066 void SetMainText(vtkTextureText *t);
00067
00068 vtkGetObjectMacro(Box, vtkFollower);
00069 vtkGetObjectMacro(BoxRectangle, vtkRectangle);
00070
00071 vtkGetMacro(BorderWidth, vtkFloatingPointType);
00072 vtkGetMacro(BoxEdgeWidth, vtkFloatingPointType);
00073 vtkGetMacro(BoxEdgeBias, vtkFloatingPointType);
00074 vtkGetMacro(BoxDistanceZ, vtkFloatingPointType);
00075
00076 void SetBorderWidth(vtkFloatingPointType b);
00077 void SetBoxEdgeWidth(vtkFloatingPointType b);
00078 void SetBoxEdgeBias(vtkFloatingPointType b);
00079 void SetBoxDistanceZ(vtkFloatingPointType d);
00080
00081 vtkGetMacro(UseBoxEdge, bool);
00082 void SetUseBoxEdge(bool b);
00083
00084 vtkGetMacro(UseTexturedBoxEdge, bool);
00085 void SetUseTexturedBoxEdge(bool b);
00086
00087
00088
00089 vtkGetMacro(DefaultBoxDistanceZ, vtkFloatingPointType);
00090 vtkSetMacro(DefaultBoxDistanceZ, vtkFloatingPointType);
00091
00092 vtkGetMacro(DefaultBorderWidth, vtkFloatingPointType);
00093 vtkSetMacro(DefaultBorderWidth, vtkFloatingPointType);
00094
00095 vtkGetMacro(DefaultBoxEdgeWidth, vtkFloatingPointType);
00096 vtkSetMacro(DefaultBoxEdgeWidth, vtkFloatingPointType);
00097
00098 vtkGetMacro(DefaultUseBoxEdge, bool);
00099 vtkSetMacro(DefaultUseBoxEdge, bool);
00100
00101 vtkGetMacro(DefaultBoxEdgeBias, vtkFloatingPointType);
00102 vtkSetMacro(DefaultBoxEdgeBias, vtkFloatingPointType);
00103
00104 static vtkFloatingPointType DefaultBoxColor[3];
00105 vtkFloatingPointType BoxColor[3];
00106
00107 static vtkFloatingPointType DefaultBoxEdgeColor[3];
00108 vtkFloatingPointType BoxEdgeColor[3];
00109
00110 static void SetDefaultBoxColor(vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b);
00111 void SetBoxColor(vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b);
00112
00113 static void SetDefaultBoxEdgeColor(vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b);
00114 void SetBoxEdgeColor(vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b);
00115
00116
00117
00118
00119
00120 vtkFollower *CreateBox();
00121 vtkFollower *UpdateBox();
00122 void CreateBoxEdge();
00123 void RemoveBoxEdge();
00124
00125 vtkGetMacro(BoxWidthMinimum, vtkFloatingPointType);
00126 vtkSetMacro(BoxWidthMinimum, vtkFloatingPointType);
00127 vtkGetMacro(BoxHeightMinimum, vtkFloatingPointType);
00128 vtkSetMacro(BoxHeightMinimum, vtkFloatingPointType);
00129
00130
00131 void SetPosition(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00132 void SetPosition (vtkFloatingPointType _arg[3]);
00133
00134
00135 void AddPositionOffset(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00136
00137
00138 void SetOffsetActorAndMarker(vtkActor *a, vtkFloatingPointType markerX, vtkFloatingPointType markerY, vtkFloatingPointType markerZ,
00139 vtkFloatingPointType offX, vtkFloatingPointType offY, vtkFloatingPointType offZ);
00140 void SetOffsetActorAndMarker(vtkActor *a, vtkActor *m, vtkFloatingPointType offX, vtkFloatingPointType offY, vtkFloatingPointType offZ);
00141 void SetOffsetActorAndMarker(vtkActor *a, vtkActor *m, vtkFloatingPointType off[3]);
00142 void UpdateOffsetActorAndMarker();
00143
00144
00145 void GetPosition (vtkFloatingPointType data[3]);
00146
00147
00148 void SetScale(vtkFloatingPointType s);
00149
00150 void Center();
00151 void CenterOffset();
00152
00153
00154
00155
00156 void Modified();
00157
00158 void SetOthersVisibility(bool v);
00159 void OthersVisibilityOn();
00160 void OthersVisibilityOff();
00161 vtkGetMacro(OthersVisibility, bool);
00162
00163 void SetVisibility(bool v);
00164 void SetOpacityBase(vtkFloatingPointType o);
00165
00166 void SetCamera(vtkCamera *cam);
00167
00168
00169
00170 void RemoveActors(vtkRenderer *r);
00171 void RemoveActors();
00172 void AddActors(vtkRenderer *r);
00173 void AddActors();
00174
00175
00176 vtkCollection *GetOtherTexts();
00177
00178
00179 vtkActor *CreateLine(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00180
00181 void SetLinePoint1(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00182 void SetLinePoint1Local(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00183 void SetLinePoint2(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z);
00184
00185 vtkGetObjectMacro(LineActor, vtkActor);
00186 vtkGetObjectMacro(LineSource, vtkLineSource);
00187
00188 vtkGetObjectMacro(Texture, vtkTexture);
00189 vtkSetObjectMacro(Texture, vtkTexture);
00190
00191 vtkGetObjectMacro(Renderer, vtkRenderer);
00192 vtkSetObjectMacro(Renderer, vtkRenderer);
00193
00194 vtkGetMacro(LevelNum, int);
00195 vtkSetMacro(LevelNum, int);
00196
00197 vtkGetMacro(LevelX, vtkFloatingPointType);
00198 vtkSetMacro(LevelX, vtkFloatingPointType);
00199
00200 void SetDim(bool d);
00201
00202
00203
00204
00205
00206
00207
00208 vtkCollection *GetImageFollowers();
00209 vtkCollection *GetImageRectangles();
00210
00211 static char *LoadString(char *filename);
00212
00213
00214 protected:
00215 vtkCard();
00216 ~vtkCard();
00217
00218 vtkTextureText *MainText;
00219 vtkFollower *Box;
00220 vtkRectangle *BoxRectangle;
00221
00222
00223 vtkFollower *BoxEdge[VTK_TEXT_CARD_EDGE_COUNT];
00224 vtkRectangle *BoxEdgeRectangle[VTK_TEXT_CARD_EDGE_COUNT];
00225
00226 static bool DefaultUseBoxEdge;
00227 bool UseBoxEdge;
00228 bool UseTexturedBoxEdge;
00229 int BoxEdgeCount;
00230
00231 vtkFloatingPointType BoxWidthMinimum;
00232 vtkFloatingPointType BoxHeightMinimum;
00233
00234 vtkActor *OffsetActor;
00235 vtkActor *OffsetMarker;
00236
00237 Vector3D<vtkFloatingPointType> OffsetVector;
00238 Vector3D<vtkFloatingPointType> OffsetMarkerVector;
00239
00240
00241 vtkFloatingPointType UnscaledBorderWidth;
00242 vtkFloatingPointType BorderWidth;
00243 vtkFloatingPointType UnscaledBoxEdgeWidth;
00244 vtkFloatingPointType BoxEdgeWidth;
00245 vtkFloatingPointType UnscaledBoxEdgeBias;
00246 vtkFloatingPointType BoxEdgeBias;
00247 vtkFloatingPointType UnscaledBoxDistanceZ;
00248 vtkFloatingPointType BoxDistanceZ;
00249
00250 vtkFloatingPointType ScaleFactor;
00251
00252 static vtkFloatingPointType DefaultBoxDistanceZ;
00253 static vtkFloatingPointType DefaultBorderWidth;
00254 static vtkFloatingPointType DefaultBoxEdgeWidth;
00255 static vtkFloatingPointType DefaultBoxEdgeBias;
00256
00257 bool OthersVisibility;
00258
00259 vtkCollection *OtherTexts;
00260
00261
00262
00263 vtkCollection *ImageFollowers;
00264 vtkCollection *ImageRectangles;
00265
00266 vtkActor *LineActor;
00267
00268 vtkLineSource *LineSource;
00269
00270
00271 bool Dim;
00272
00273 vtkFloatingPointType BoxOpacity;
00274 vtkFloatingPointType TextOpacity;
00275
00276 vtkTexture *Texture;
00277
00278 vtkRenderer *Renderer;
00279
00280
00281 int LevelNum;
00282 vtkFloatingPointType LevelX;
00283
00284
00285 private:
00286 vtkCard(const vtkCard&);
00287 void operator=(const vtkCard&);
00288 };
00289
00290 #endif
00291
00292