TangentialVectors.hpp

00001 #ifndef __BASEOP_TANGENTIALVECTORS_HPP
00002 #define __BASEOP_TANGENTIALVECTORS_HPP
00003 
00004 #include "gridopDllApi.h"
00005 #include <grid/Representation.hpp>
00006 #include <grid/Grid.hpp>
00007 #include <eagle/PhysicalSpace.hpp>
00008 
00009 
00010 namespace Fiber
00011 {
00012 
00017 extern gridop_API const char TangentialVectorFieldName[];
00018 
00023 extern gridop_API const char CurveParameterFieldName[];
00024 
00028 extern gridop_API RefPtr<MemArray<1, Eagle::tvector3> >
00029         ComputeTangentialVectors(const MemArray<1, Eagle::point3>&Vertices,
00030                                  const MemArray<1, std::vector<index_t> >&EdgesArray,
00031                                  const MemBase::Creator_t&Crec);
00032 
00040 extern gridop_API RefPtr<MemArray<1, Eagle::tvector3> >
00041         getTangentialVectors(Grid&G, const string&FieldName = TangentialVectorFieldName);
00042 
00043 
00047 struct  gridop_API TangentialVectorsAndCurveParameter
00048 {
00049         RefPtr<MemArray<1, Eagle::tvector3> >   TangentialVectors;
00050         double                                  max_len;
00051         RefPtr<MemArray<1, double > >           CurveParameter;
00052 
00053         void compute(const MemArray<1, Eagle::point3>&Vertices,
00054                      const MemArray<1, std::vector<index_t> >&EdgesArray,
00055                      const MemBase::Creator_t&Crec = NullPtr() );
00056 
00057 
00061         TangentialVectorsAndCurveParameter(const MemArray<1, Eagle::point3>&Vertices,
00062                                            const MemArray<1, std::vector<index_t> >&EdgesArray)
00063         {
00064                 compute(Vertices, EdgesArray);
00065         } 
00066 
00067         struct  gridop_API Exception : std::exception
00068         {}; 
00069 
00070         struct  gridop_API NoEdges : Exception {};
00071         struct  gridop_API NoVertices : Exception {};
00072         struct  gridop_API NoVertexField : Exception {}; 
00073         struct  gridop_API NoEdgesAsVertices : NoEdges {};
00074         struct  gridop_API NoEdgePositions : NoEdges {}; 
00075         struct  gridop_API NoVertexFieldCreator : NoVertices {};
00076         struct  gridop_API NoVertexFieldData : NoVertices {};
00077 
00084         TangentialVectorsAndCurveParameter(Grid&G, 
00085                                            const string&TangentFieldName = TangentialVectorFieldName,
00086                                            const string&LengthFieldName = CurveParameterFieldName);
00087 };
00088 
00089 
00090 } // namespace Fiber
00091 
00092 #endif // __BASEOP_TANGENTIALVECTORS_HPP
00093