VTK
dox/Graphics/vtkDataSetEdgeSubdivisionCriterion.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDataSetEdgeSubdivisionCriterion.h
00005   Language:  C++
00006 
00007   Copyright 2003 Sandia Corporation.
00008   Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009   license for use of this work by or on behalf of the
00010   U.S. Government. Redistribution and use in source and binary forms, with
00011   or without modification, are permitted provided that this Notice and any
00012   statement of authorship are reproduced on all copies.
00013 
00014 =========================================================================*/
00015 #ifndef __vtkDataSetEdgeSubdivisionCriterion_h
00016 #define __vtkDataSetEdgeSubdivisionCriterion_h
00017 
00041 #include "vtkEdgeSubdivisionCriterion.h"
00042 
00043 class vtkCell;
00044 class vtkDataSet;
00045 
00046 class VTK_GRAPHICS_EXPORT vtkDataSetEdgeSubdivisionCriterion : public vtkEdgeSubdivisionCriterion
00047 {
00048   public:
00049     vtkTypeMacro(vtkDataSetEdgeSubdivisionCriterion,vtkEdgeSubdivisionCriterion);
00050     static vtkDataSetEdgeSubdivisionCriterion* New();
00051     virtual void PrintSelf( ostream& os, vtkIndent indent );
00052 
00053     virtual void SetMesh( vtkDataSet* );
00054     vtkDataSet* GetMesh();
00055     //BTX
00056     const vtkDataSet* GetMesh() const;
00057     //ETX
00058 
00059     virtual void SetCellId( vtkIdType cell );
00060     vtkIdType  GetCellId() const;
00061     //BTX
00062     vtkIdType& GetCellId();
00063     //ETX
00064     vtkCell* GetCell();
00065     //BTX
00066     const vtkCell* GetCell() const;
00067     //ETX
00068 
00069     virtual bool EvaluateEdge( const double* p0, double* midpt, const double* p1, int field_start );
00070 
00100     double* EvaluateFields( double* vertex, double* weights, int field_start );
00101 
00103 
00106     void EvaluatePointDataField( double* result, double* weights, int field );
00107     void EvaluateCellDataField( double* result, double* weights, int field );
00109 
00111 
00113     vtkSetMacro(ChordError2,double);
00114     vtkGetMacro(ChordError2,double);
00116 
00118 
00122     virtual void SetFieldError2( int s, double err );
00123     double GetFieldError2( int s ) const;
00125 
00129     virtual void ResetFieldError2();
00130 
00132 
00135     vtkGetMacro(ActiveFieldCriteria,int);
00136     int GetActiveFieldCriteria() const { return this->ActiveFieldCriteria; }
00138 
00139   protected:
00140     vtkDataSetEdgeSubdivisionCriterion();
00141     virtual ~vtkDataSetEdgeSubdivisionCriterion();
00142 
00143     vtkDataSet* CurrentMesh;
00144     vtkIdType CurrentCellId;
00145     vtkCell* CurrentCellData;
00146 
00147     double ChordError2;
00148     double* FieldError2;
00149     int FieldError2Length;
00150     int FieldError2Capacity;
00151     int ActiveFieldCriteria;
00152 
00153   private:
00154     vtkDataSetEdgeSubdivisionCriterion( const vtkDataSetEdgeSubdivisionCriterion& ); // Not implemented.
00155     void operator = ( const vtkDataSetEdgeSubdivisionCriterion& ); // Not implemented.
00156 
00157 };
00158 
00159 //BTX
00160 
00161 inline vtkIdType& vtkDataSetEdgeSubdivisionCriterion::GetCellId()       { return this->CurrentCellId; }
00162 inline vtkIdType  vtkDataSetEdgeSubdivisionCriterion::GetCellId() const { return this->CurrentCellId; }
00163 
00164 inline       vtkDataSet* vtkDataSetEdgeSubdivisionCriterion::GetMesh()       { return this->CurrentMesh; }
00165 inline const vtkDataSet* vtkDataSetEdgeSubdivisionCriterion::GetMesh() const { return this->CurrentMesh; }
00166 
00167 inline       vtkCell* vtkDataSetEdgeSubdivisionCriterion::GetCell()       { return this->CurrentCellData; }
00168 inline const vtkCell* vtkDataSetEdgeSubdivisionCriterion::GetCell() const { return this->CurrentCellData; }
00169 
00170 //ETX
00171 
00172 #endif // __vtkDataSetEdgeSubdivisionCriterion_h