libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
moMathDVector.h
Ir a la documentación de este archivo.
1
/*******************************************************************************
2
3
moMathDVector.h
4
5
****************************************************************************
6
* *
7
* This source is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This code is distributed in the hope that it will be useful, but *
13
* WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15
* General Public License for more details. *
16
* *
17
* A copy of the GNU General Public License is available on the World *
18
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19
* obtain it by writing to the Free Software Foundation, *
20
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
* *
22
****************************************************************************
23
24
Copyright(C) 2006 Fabricio Costa
25
26
Authors:
27
Fabricio Costa
28
Andrés Colubri
29
30
Portions taken from
31
Wild Magic Source Code
32
David Eberly
33
http://www.geometrictools.com
34
Copyright (c) 1998-2007
35
36
*******************************************************************************/
37
38
#include "
moMath.h
"
39
40
#ifndef __MO_MATH_DVECTOR_H__
41
#define __MO_MATH_DVECTOR_H__
42
43
template
<
class
Real>
44
class
LIBMOLDEO_API
moDVector
:
public
moAbstract
45
{
46
public
:
47
// construction
48
moDVector
(
int
iSize = 0);
49
moDVector
(
int
iSize,
const
Real* afTuple);
50
moDVector
(
const
moDVector
& rkV);
51
~
moDVector
();
52
53
// coordinate access
54
void
SetSize (
int
iSize);
55
int
GetSize ()
const
;
56
operator
const
Real* ()
const
;
57
operator
Real* ();
58
Real operator[] (
int
i)
const
;
59
Real& operator[] (
int
i);
60
61
// assignment
62
moDVector
& operator= (
const
moDVector
& rkV);
63
64
// comparison
65
bool
operator==
(
const
moDVector
& rkV)
const
;
66
bool
operator!=
(
const
moDVector
& rkV)
const
;
67
bool
operator<
(
const
moDVector
& rkV)
const
;
68
bool
operator<=
(
const
moDVector
& rkV)
const
;
69
bool
operator>
(
const
moDVector
& rkV)
const
;
70
bool
operator>=
(
const
moDVector
& rkV)
const
;
71
72
// arithmetic operations
73
moDVector
operator+
(
const
moDVector
& rkV)
const
;
74
moDVector
operator- (
const
moDVector
& rkV)
const
;
75
moDVector
operator*
(Real fScalar)
const
;
76
moDVector
operator/ (Real fScalar)
const
;
77
moDVector
operator- ()
const
;
78
79
// arithmetic updates
80
moDVector
& operator+= (
const
moDVector
& rkV);
81
moDVector
& operator-= (
const
moDVector
& rkV);
82
moDVector
& operator*= (Real fScalar);
83
moDVector
& operator/= (Real fScalar);
84
85
// vector operations
86
Real Length ()
const
;
87
Real SquaredLength ()
const
;
88
Real Dot (
const
moDVector
& rkV)
const
;
89
Real Normalize ();
90
91
protected
:
92
// support for comparisons
93
int
CompareArrays (
const
moDVector
& rkV)
const
;
94
95
int
m_iSize
;
96
Real*
m_afTuple
;
97
};
98
99
template
<
class
Real>
100
moDVector<Real>
operator*
(Real fScalar,
const
moDVector<Real>
& rkV);
101
102
#ifndef MO_MACOSX
103
#ifndef MO_RASPBIAN
104
template
class
LIBMOLDEO_API
moDVector<MOfloat>
;
105
#endif
106
#endif
107
typedef
moDVector<MOfloat>
moDVectorf
;
108
109
#ifndef MO_MACOSX
110
#ifndef MO_RASPBIAN
111
template
class
LIBMOLDEO_API
moDVector<MOdouble>
;
112
#endif
113
#endif
114
typedef
moDVector<MOdouble>
moDVectord
;
115
116
117
#endif
118
operator>
bool operator>(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:280
operator<
bool operator<(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:274
moMath.h
moDVector::m_iSize
int m_iSize
Definition:
moMathDVector.h:95
moDVectord
moDVector< MOdouble > moDVectord
Definition:
moMathDVector.h:114
moAbstract
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition:
moAbstract.h:191
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
moDVector::m_afTuple
Real * m_afTuple
Definition:
moMathDVector.h:96
moDVector
Definition:
moMathDVector.h:44
operator+
LIBMOLDEO_API moText0 operator+(const moText0 &txt1, const moText0 &txt2)
Definition:
moText.cpp:415
operator==
bool operator==(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:269
operator>=
bool operator>=(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:282
operator!=
bool operator!=(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:279
operator<=
bool operator<=(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.h:281
operator*
moDVector< Real > operator*(Real fScalar, const moDVector< Real > &rkV)
Definition:
moMathDVector.cpp:280
moDVectorf
moDVector< MOfloat > moDVectorf
Definition:
moMathDVector.h:107
libmoldeo
moMathDVector.h
Generado el Martes, 10 de Septiembre de 2019 21:27:07 para libmoldeo (Moldeo 1.0 Core) por
1.8.13