00001
00002
00003
00004
00005
00006
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029
00030 #ifndef FUNCTIONS0D_H
00031 # define FUNCTIONS0D_H
00032
00033 # include "../system/Precision.h"
00034 # include "Interface0D.h"
00035 # include "../geometry/Geom.h"
00036 # include "../system/Exception.h"
00037 # include "../scene_graph/Material.h"
00038 # include <set>
00039 # include <vector>
00040 class FEdge;
00041 class ViewEdge;
00042 class SShape;
00043
00044 using namespace Geometry;
00045
00046
00047
00048
00050
00051 template <class T>
00069 class UnaryFunction0D
00070 {
00071 public:
00072
00076 typedef T ReturnedValueType;
00078 UnaryFunction0D() {}
00080 virtual ~UnaryFunction0D() {}
00082 virtual string getName() const {
00083 return "UnaryFunction0D";
00084 }
00092 virtual T operator()(Interface0DIterator& iter) {
00093 cerr << "Warning: operator() not implemented" << endl;
00094 return T();
00095 }
00096 };
00097
00098 # ifdef SWIG
00099 %feature("director") UnaryFunction0D<void>;
00100 %feature("director") UnaryFunction0D<unsigned>;
00101 %feature("director") UnaryFunction0D<float>;
00102 %feature("director") UnaryFunction0D<double>;
00103 %feature("director") UnaryFunction0D<Vec2f>;
00104 %feature("director") UnaryFunction0D<Vec3f>;
00105 %feature("director") UnaryFunction0D<Id>;
00106
00107 %template(UnaryFunction0DVoid) UnaryFunction0D<void>;
00108 %template(UnaryFunction0DUnsigned) UnaryFunction0D<unsigned>;
00109 %template(UnaryFunction0DFloat) UnaryFunction0D<float>;
00110 %template(UnaryFunction0DDouble) UnaryFunction0D<double>;
00111 %template(UnaryFunction0DVec2f) UnaryFunction0D<Vec2f>;
00112 %template(UnaryFunction0DVec3f) UnaryFunction0D<Vec3f>;
00113 %template(UnaryFunction0DId) UnaryFunction0D<Id>;
00114 %template(UnaryFunction0DViewShape) UnaryFunction0D<ViewShape*>;
00115 %template(UnaryFunction0DVectorViewShape) UnaryFunction0D<std::vector<ViewShape*> >;
00116 # endif // SWIG
00117
00118
00119
00120
00121
00123 class ViewShape;
00124 namespace Functions0D {
00125
00126
00128 class LIB_VIEW_MAP_EXPORT GetXF0D : public UnaryFunction0D<real>
00129 {
00130 public:
00132 string getName() const {
00133 return "GetXF0D";
00134 }
00136 real operator()(Interface0DIterator& iter) {
00137 return iter->getX();
00138 }
00139 };
00140
00141
00143 class LIB_VIEW_MAP_EXPORT GetYF0D : public UnaryFunction0D<real>
00144 {
00145 public:
00147 string getName() const {
00148 return "GetYF0D";
00149 }
00151 real operator()(Interface0DIterator& iter) {
00152 return iter->getY();
00153 }
00154 };
00155
00156
00158 class LIB_VIEW_MAP_EXPORT GetZF0D : public UnaryFunction0D<real>
00159 {
00160 public:
00162 string getName() const {
00163 return "GetZF0D";
00164 }
00166 real operator()(Interface0DIterator& iter) {
00167 return iter->getZ();
00168 }
00169 };
00170
00171
00173 class LIB_VIEW_MAP_EXPORT GetProjectedXF0D : public UnaryFunction0D<real>
00174 {
00175 public:
00177 string getName() const {
00178 return "GetProjectedXF0D";
00179 }
00181 real operator()(Interface0DIterator& iter) {
00182 return iter->getProjectedX();
00183 }
00184 };
00185
00186
00188 class LIB_VIEW_MAP_EXPORT GetProjectedYF0D : public UnaryFunction0D<real>
00189 {
00190 public:
00192 string getName() const {
00193 return "GetProjectedYF0D";
00194 }
00196 real operator()(Interface0DIterator& iter) {
00197 return iter->getProjectedY();
00198 }
00199 };
00200
00201
00203 class LIB_VIEW_MAP_EXPORT GetProjectedZF0D : public UnaryFunction0D<real>
00204 {
00205 public:
00207 string getName() const {
00208 return "GetProjectedZF0D";
00209 }
00211 real operator()(Interface0DIterator& iter) {
00212 return iter->getProjectedZ();
00213 }
00214 };
00215
00216
00218 class LIB_VIEW_MAP_EXPORT GetCurvilinearAbscissaF0D : public UnaryFunction0D<float>
00219 {
00220 public:
00222 string getName() const {
00223 return "GetCurvilinearAbscissaF0D";
00224 }
00226 float operator()(Interface0DIterator& iter) {
00227 return iter.t();
00228 }
00229 };
00230
00231
00233 class LIB_VIEW_MAP_EXPORT GetParameterF0D : public UnaryFunction0D<float>
00234 {
00235 public:
00237 string getName() const {
00238 return "GetParameterF0D";
00239 }
00241 float operator()(Interface0DIterator& iter) {
00242 return iter.u();
00243 }
00244 };
00245
00246
00251 class LIB_VIEW_MAP_EXPORT VertexOrientation2DF0D : public UnaryFunction0D<Vec2f>
00252 {
00253 public:
00255 string getName() const {
00256 return "VertexOrientation2DF0D";
00257 }
00259 Vec2f operator()(Interface0DIterator& iter);
00260 };
00261
00262
00267 class LIB_VIEW_MAP_EXPORT VertexOrientation3DF0D : public UnaryFunction0D<Vec3f>
00268 {
00269 public:
00271 string getName() const {
00272 return "VertexOrientation3DF0D";
00273 }
00275 Vec3f operator()(Interface0DIterator& iter);
00276 };
00277
00278
00283 class LIB_VIEW_MAP_EXPORT Curvature2DAngleF0D : public UnaryFunction0D<real>
00284 {
00285 public:
00287 string getName() const {
00288 return "Curvature2DAngleF0D";
00289 }
00291 real operator()(Interface0DIterator& iter);
00292 };
00293
00294
00301 class LIB_VIEW_MAP_EXPORT ZDiscontinuityF0D : public UnaryFunction0D<real>
00302 {
00303 public:
00305 string getName() const {
00306 return "ZDiscontinuityF0D";
00307 }
00309 real operator()(Interface0DIterator& iter);
00310 };
00311
00312
00317 class LIB_VIEW_MAP_EXPORT Normal2DF0D : public UnaryFunction0D<Vec2f>
00318 {
00319 public:
00321 string getName() const {
00322 return "Normal2DF0D";
00323 }
00325 Vec2f operator()(Interface0DIterator& iter);
00326 };
00327
00328
00340 class LIB_VIEW_MAP_EXPORT MaterialF0D : public UnaryFunction0D<Material>
00341 {
00342 public:
00344 string getName() const {
00345 return "MaterialF0D";
00346 }
00348 Material operator()(Interface0DIterator& iter);
00349 };
00350
00351
00361 class LIB_VIEW_MAP_EXPORT ShapeIdF0D : public UnaryFunction0D<Id>
00362 {
00363 public:
00365 string getName() const {
00366 return "ShapeIdF0D";
00367 }
00369 Id operator()(Interface0DIterator& iter);
00370 };
00371
00372
00382 class LIB_VIEW_MAP_EXPORT QuantitativeInvisibilityF0D : public UnaryFunction0D<unsigned int>
00383 {
00384 public:
00386 string getName() const {
00387 return "QuantitativeInvisibilityF0D";
00388 }
00390 unsigned int operator()(Interface0DIterator& iter);
00391 };
00392
00393
00397 class LIB_VIEW_MAP_EXPORT CurveNatureF0D : public UnaryFunction0D<Nature::EdgeNature>
00398 {
00399 public:
00401 string getName() const {
00402 return "CurveNatureF0D";
00403 }
00405 Nature::EdgeNature operator()(Interface0DIterator& iter);
00406 };
00407
00408
00412 class LIB_VIEW_MAP_EXPORT GetShapeF0D : public UnaryFunction0D< ViewShape*>
00413 {
00414 public:
00416 string getName() const {
00417 return "GetShapeF0D";
00418 }
00420 ViewShape* operator()(Interface0DIterator& iter);
00421 };
00422
00423
00427 class LIB_VIEW_MAP_EXPORT GetOccludersF0D : public UnaryFunction0D< std::vector<ViewShape*> >
00428 {
00429 public:
00431 string getName() const {
00432 return "GetOccludersF0D";
00433 }
00435 std::vector<ViewShape*> operator()(Interface0DIterator& iter);
00436 };
00437
00438
00442 class LIB_VIEW_MAP_EXPORT GetOccludeeF0D: public UnaryFunction0D< ViewShape*>
00443 {
00444 public:
00446 string getName() const {
00447 return "GetOccludeeF0D";
00448 }
00450 ViewShape* operator()(Interface0DIterator& iter);
00451 };
00452
00453
00454
00456
00457
00458 LIB_VIEW_MAP_EXPORT
00459 FEdge* getFEdge(Interface0D& it1, Interface0D& it2);
00460
00461
00462 LIB_VIEW_MAP_EXPORT
00463 void getFEdges(Interface0DIterator& it,
00464 FEdge*& fe1,
00465 FEdge*& fe2);
00466
00467
00468 LIB_VIEW_MAP_EXPORT
00469 void getViewEdges(Interface0DIterator& it,
00470 ViewEdge *&ve1,
00471 ViewEdge *&ve2);
00472
00473
00474 LIB_VIEW_MAP_EXPORT
00475 ViewShape* getShapeF0D(Interface0DIterator& it);
00476
00477
00478 LIB_VIEW_MAP_EXPORT
00479 void getOccludersF0D(Interface0DIterator& it, std::set<ViewShape*>& oOccluders);
00480
00481
00482 LIB_VIEW_MAP_EXPORT
00483 ViewShape* getOccludeeF0D(Interface0DIterator& it);
00484
00485 }
00486
00487 #endif // FUNCTIONS0D_H