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

Hybrid/vtkCubeAxesActor2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCubeAxesActor2D.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00077 #ifndef __vtkCubeAxesActor2D_h
00078 #define __vtkCubeAxesActor2D_h
00079 
00080 #include "vtkAxisActor2D.h"
00081 #include "vtkCamera.h"
00082 
00083 #define VTK_FLY_OUTER_EDGES 0
00084 #define VTK_FLY_CLOSEST_TRIAD 1
00085 
00086 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00087 {
00088 public:
00089   vtkTypeMacro(vtkCubeAxesActor2D,vtkActor2D);
00090   void PrintSelf(ostream& os, vtkIndent indent);
00091 
00095   static vtkCubeAxesActor2D *New();
00096   
00098 
00099   int RenderOverlay(vtkViewport*);
00100   int RenderOpaqueGeometry(vtkViewport*);
00101   int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00103 
00105 
00108   vtkSetObjectMacro(Input, vtkDataSet);
00109   vtkGetObjectMacro(Input, vtkDataSet);
00111 
00113 
00115   vtkSetObjectMacro(Prop, vtkProp);
00116   vtkGetObjectMacro(Prop, vtkProp);
00118   
00120 
00124   vtkSetVector6Macro(Bounds,float);
00125   float *GetBounds();
00126   void GetBounds(float& xmin, float& xmax, float& ymin, float& ymax, 
00127                  float& zmin, float& zmax);
00128   void GetBounds(float bounds[6]);
00130 
00132 
00135   vtkSetVector6Macro(Ranges,float);
00136   float *GetRanges();
00137   void GetRanges(float& xmin, float& xmax, float& ymin, float& ymax, 
00138                  float& zmin, float& zmax);
00139   void GetRanges(float ranges[6]);  
00141 
00143 
00145   vtkSetMacro(UseRanges,int);
00146   vtkGetMacro(UseRanges,int);
00147   vtkBooleanMacro(UseRanges,int);
00149 
00151 
00153   vtkSetObjectMacro(Camera,vtkCamera);
00154   vtkGetObjectMacro(Camera,vtkCamera);
00156 
00158 
00160   vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00161   vtkGetMacro(FlyMode, int);
00162   void SetFlyModeToOuterEdges()
00163     {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00164   void SetFlyModeToClosestTriad()
00165     {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00167 
00169 
00173   vtkSetMacro(Scaling,int);
00174   vtkGetMacro(Scaling,int);
00175   vtkBooleanMacro(Scaling,int);
00177 
00179 
00182   vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00183   vtkGetMacro(NumberOfLabels, int);
00185   
00187 
00189   vtkSetStringMacro(XLabel);
00190   vtkGetStringMacro(XLabel);
00191   vtkSetStringMacro(YLabel);
00192   vtkGetStringMacro(YLabel);
00193   vtkSetStringMacro(ZLabel);
00194   vtkGetStringMacro(ZLabel);
00196 
00198 
00199   vtkSetMacro(Bold, int);
00200   vtkGetMacro(Bold, int);
00201   vtkBooleanMacro(Bold, int);
00203 
00205 
00206   vtkSetMacro(Italic, int);
00207   vtkGetMacro(Italic, int);
00208   vtkBooleanMacro(Italic, int);
00210 
00212 
00214   vtkSetMacro(Shadow, int);
00215   vtkGetMacro(Shadow, int);
00216   vtkBooleanMacro(Shadow, int);
00218 
00220 
00223   vtkSetMacro(FontFamily, int);
00224   vtkGetMacro(FontFamily, int);
00225   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00226   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00227   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00229 
00231 
00233   vtkSetStringMacro(LabelFormat);
00234   vtkGetStringMacro(LabelFormat);
00236   
00238 
00240   vtkSetClampMacro(FontFactor, float, 0.1, 2.0);
00241   vtkGetMacro(FontFactor, float);
00243 
00245 
00248   vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00249   vtkGetMacro(Inertia, float);
00251 
00253 
00256   vtkSetMacro(CornerOffset, float);
00257   vtkGetMacro(CornerOffset, float);
00259 
00263   void ReleaseGraphicsResources(vtkWindow *);
00264 
00266 
00267   vtkSetMacro(XAxisVisibility,int);
00268   vtkGetMacro(XAxisVisibility,int);
00269   vtkBooleanMacro(XAxisVisibility,int);
00270   vtkSetMacro(YAxisVisibility,int);
00271   vtkGetMacro(YAxisVisibility,int);
00272   vtkBooleanMacro(YAxisVisibility,int);
00273   vtkSetMacro(ZAxisVisibility,int);
00274   vtkGetMacro(ZAxisVisibility,int);
00275   vtkBooleanMacro(ZAxisVisibility,int);
00277 
00279   void ShallowCopy(vtkCubeAxesActor2D *actor);
00280 
00281 protected:
00282   vtkCubeAxesActor2D();
00283   ~vtkCubeAxesActor2D();
00284 
00285   vtkDataSet *Input;    //Define bounds from input data, or
00286   vtkProp    *Prop;     //Define bounds from actor/assembly, or
00287   float      Bounds[6]; //Define bounds explicitly
00288   float      Ranges[6]; //Define ranges explicitly
00289   int        UseRanges; //Flag to use ranges or not
00290 
00291   vtkCamera *Camera;
00292   int FlyMode;
00293   int Scaling;
00294   
00295   vtkAxisActor2D *XAxis;
00296   vtkAxisActor2D *YAxis;
00297   vtkAxisActor2D *ZAxis;
00298   
00299   int   NumberOfLabels;
00300   char *XLabel;
00301   char *YLabel;
00302   char *ZLabel;
00303   char *Labels[3];
00304 
00305   int XAxisVisibility;
00306   int YAxisVisibility;
00307   int ZAxisVisibility;
00308 
00309   int   Bold;
00310   int   Italic;
00311   int   Shadow;
00312   int   FontFamily;
00313   char  *LabelFormat;
00314   float FontFactor;
00315   float CornerOffset;
00316   int   Inertia;
00317   int   RenderCount;
00318   int   InertiaAxes[8];
00319   
00320   int RenderSomething;
00321   
00322   // various helper methods
00323   void TransformBounds(vtkViewport *viewport, float bounds[6], 
00324                        float pts[8][3]);
00325   int ClipBounds(vtkViewport *viewport, float pts[8][3], float bounds[6]);
00326   float EvaluatePoint(float planes[24], float x[3]);
00327   float EvaluateBounds(float planes[24], float bounds[6]);
00328   void AdjustAxes(float pts[8][3], float bounds[6], 
00329                   int idx, int xIdx, int yIdx, int zIdx, int zIdx2, 
00330                   int xAxes, int yAxes, int zAxes,
00331                   float xCoords[4], float yCoords[4], float zCoords[4],
00332                   float xRange[2], float yRange[2], float zRange[2]);
00333 
00334 private:
00335   // hide the superclass' ShallowCopy() from the user and the compiler.
00336   void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00337 private:
00338   vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);  // Not implemented.
00339   void operator=(const vtkCubeAxesActor2D&);  // Not implemented.
00340 };
00341 
00342 
00343 #endif

Generated on Thu Mar 28 14:19:23 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001