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

contrib/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 =========================================================================*/
00073 #ifndef __vtkCubeAxesActor2D_h
00074 #define __vtkCubeAxesActor2D_h
00075 
00076 #include "vtkAxisActor2D.h"
00077 #include "vtkCamera.h"
00078 
00079 #define VTK_FLY_OUTER_EDGES 0
00080 #define VTK_FLY_CLOSEST_TRIAD 1
00081 
00082 class VTK_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00083 {
00084 public:
00085   vtkTypeMacro(vtkCubeAxesActor2D,vtkActor2D);
00086   void PrintSelf(ostream& os, vtkIndent indent);
00087 
00091   static vtkCubeAxesActor2D *New();
00092   
00094   int RenderOverlay(vtkViewport*);
00095   int RenderOpaqueGeometry(vtkViewport*);
00096   int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00097 
00101   vtkSetObjectMacro(Input, vtkDataSet);
00102   vtkGetObjectMacro(Input, vtkDataSet);
00103 
00106   vtkSetObjectMacro(Prop, vtkProp);
00107   vtkGetObjectMacro(Prop, vtkProp);
00108   
00113   vtkSetVector6Macro(Bounds,float);
00114   float *GetBounds();
00115   void GetBounds(float& xmin, float& xmax, float& ymin, float& ymax, 
00116                  float& zmin, float& zmax);
00117   void GetBounds(float bounds[6]);
00118 
00121   vtkSetObjectMacro(Camera,vtkCamera);
00122   vtkGetObjectMacro(Camera,vtkCamera);
00123 
00126   vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00127   vtkGetMacro(FlyMode, int);
00128   void SetFlyModeToOuterEdges()
00129     {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00130   void SetFlyModeToClosestTriad()
00131     {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00132 
00137   vtkSetMacro(Scaling,int);
00138   vtkGetMacro(Scaling,int);
00139   vtkBooleanMacro(Scaling,int);
00140 
00144   vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00145   vtkGetMacro(NumberOfLabels, int);
00146   
00149   vtkSetStringMacro(XLabel);
00150   vtkGetStringMacro(XLabel);
00151   vtkSetStringMacro(YLabel);
00152   vtkGetStringMacro(YLabel);
00153   vtkSetStringMacro(ZLabel);
00154   vtkGetStringMacro(ZLabel);
00155 
00157   vtkSetMacro(Bold, int);
00158   vtkGetMacro(Bold, int);
00159   vtkBooleanMacro(Bold, int);
00160 
00162   vtkSetMacro(Italic, int);
00163   vtkGetMacro(Italic, int);
00164   vtkBooleanMacro(Italic, int);
00165 
00168   vtkSetMacro(Shadow, int);
00169   vtkGetMacro(Shadow, int);
00170   vtkBooleanMacro(Shadow, int);
00171 
00175   vtkSetMacro(FontFamily, int);
00176   vtkGetMacro(FontFamily, int);
00177   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00178   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00179   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00180 
00183   vtkSetStringMacro(LabelFormat);
00184   vtkGetStringMacro(LabelFormat);
00185   
00188   vtkSetClampMacro(FontFactor, float, 0.1, 2.0);
00189   vtkGetMacro(FontFactor, float);
00190 
00194   vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00195   vtkGetMacro(Inertia, float);
00196 
00200   vtkSetMacro(CornerOffset, float);
00201   vtkGetMacro(CornerOffset, float);
00202 
00206   void ReleaseGraphicsResources(vtkWindow *);
00207 
00209   vtkSetMacro(XAxisVisibility,int);
00210   vtkGetMacro(XAxisVisibility,int);
00211   vtkBooleanMacro(XAxisVisibility,int);
00212   vtkSetMacro(YAxisVisibility,int);
00213   vtkGetMacro(YAxisVisibility,int);
00214   vtkBooleanMacro(YAxisVisibility,int);
00215   vtkSetMacro(ZAxisVisibility,int);
00216   vtkGetMacro(ZAxisVisibility,int);
00217   vtkBooleanMacro(ZAxisVisibility,int);
00218 
00220   void ShallowCopy(vtkCubeAxesActor2D *actor);
00221 
00222 protected:
00223   vtkCubeAxesActor2D();
00224   ~vtkCubeAxesActor2D();
00225   vtkCubeAxesActor2D(const vtkCubeAxesActor2D&) {};
00226   void operator=(const vtkCubeAxesActor2D&) {};
00227 
00228   vtkDataSet *Input;    //Define bounds from input data, or
00229   vtkProp    *Prop;     //Define bounds from actor/assembly, or
00230   float      Bounds[6]; //Define bounds explicitly
00231 
00232   vtkCamera *Camera;
00233   int FlyMode;
00234   int Scaling;
00235   
00236   vtkAxisActor2D *XAxis;
00237   vtkAxisActor2D *YAxis;
00238   vtkAxisActor2D *ZAxis;
00239   
00240   int   NumberOfLabels;
00241   char *XLabel;
00242   char *YLabel;
00243   char *ZLabel;
00244   char *Labels[3];
00245 
00246   int XAxisVisibility;
00247   int YAxisVisibility;
00248   int ZAxisVisibility;
00249 
00250   int   Bold;
00251   int   Italic;
00252   int   Shadow;
00253   int   FontFamily;
00254   char  *LabelFormat;
00255   float FontFactor;
00256   float CornerOffset;
00257   int   Inertia;
00258   int   RenderCount;
00259   int   InertiaAxes[8];
00260   
00261   int RenderSomething;
00262   
00263   // various helper methods
00264   void TransformBounds(vtkViewport *viewport, float bounds[6], 
00265                        float pts[8][3]);
00266   int ClipBounds(vtkViewport *viewport, float pts[8][3], float bounds[6]);
00267   float EvaluatePoint(float planes[24], float x[3]);
00268   float EvaluateBounds(float planes[24], float bounds[6]);
00269   void AdjustAxes(float pts[8][3], float bounds[6], 
00270                   int idx, int xIdx, int yIdx, int zIdx, int zIdx2, 
00271                   int xAxes, int yAxes, int zAxes,
00272                   float xCoords[4], float yCoords[4], float zCoords[4],
00273                   float xRange[2], float yRange[2], float zRange[2]);
00274 
00275 private:
00276   // hide the superclass' ShallowCopy() from the user and the compiler.
00277   void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00278 };
00279 
00280 
00281 #endif

Generated on Wed Nov 21 12:26:55 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001