00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef freecloth_sim_simVector_h
00020 #define freecloth_sim_simVector_h
00021
00022 #ifndef freecloth_simulator_package_h
00023 #include <freecloth/simulator/package.h>
00024 #endif
00025
00026 #ifndef freecloth_geom_geVector_h
00027 #include <freecloth/geom/geVector.h>
00028 #endif
00029
00030 #ifndef freecloth_base_vector
00031 #include <freecloth/base/vector>
00032 #endif
00033
00034 FREECLOTH_NAMESPACE_START
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class SimVector {
00052
00053 public:
00054
00055
00056 typedef std::vector<GeVector> Container;
00057 typedef Container::const_iterator const_iterator;
00058 typedef Container::iterator iterator;
00059
00060
00061
00062 static SimVector zero( UInt32 size );
00063
00064
00065 SimVector();
00066 explicit SimVector( UInt32 size );
00067
00068
00069 const_iterator begin() const;
00070 const_iterator end() const;
00071 iterator begin();
00072 iterator end();
00073
00074 UInt32 size() const;
00075
00076
00077 SimVector& operator+=( const SimVector& );
00078 SimVector& operator-=( const SimVector& );
00079 SimVector& operator+=( Float );
00080 SimVector& operator-=( Float );
00081 SimVector& operator*=( Float );
00082 SimVector& operator/=( Float );
00083 SimVector operator-() const;
00084 SimVector operator+( const SimVector& ) const;
00085 SimVector operator-( const SimVector& ) const;
00086 SimVector operator+( Float ) const;
00087 SimVector operator-( Float ) const;
00088 SimVector operator*( Float ) const;
00089 SimVector operator/( Float ) const;
00090
00091
00092
00093
00094 SimVector& plusEqualsScaled( Float, const SimVector& );
00095
00096 Float dot( const SimVector& ) const;
00097 Float length() const;
00098
00099 const GeVector& operator[]( UInt32 ) const;
00100 GeVector& operator[]( UInt32 );
00101
00102
00103 void clear();
00104
00105 private:
00106
00107
00108
00109 Container _data;
00110 };
00111
00112
00113
00114
00115 std::ostream& operator<<( std::ostream&, const SimVector& );
00116 SimVector operator*( Float, SimVector const& );
00117
00118 FREECLOTH_NAMESPACE_END
00119
00120 #include <freecloth/simulator/simVector.inline.h>
00121
00122 #endif