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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moGUIManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moGUIManager.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 
29 *******************************************************************************/
30 
31 #ifndef __MOGUIMANAGER_H
32 #define __MOGUIMANAGER_H
33 
34 #include <moMathVector.h>
35 #include <moMathVector3.h>
36 #include <moMathVector4.h>
37 #include <mo3dModelManager.h>
38 
41 typedef moPointf moPoint;
52 
54  public:
56  m_Position = moPosition( 0.0, 0.0, -10.0);
57  m_Center = moPosition( 0.0, 0.0, 0.0);
58  }
59  virtual ~moCamera3D() {
60 
61  }
62  moCamera3D( const moCamera3D& p_src );
63  moCamera3D& operator=( const moCamera3D& p_src );
64  moCamera3D& operator=( const moCamera3DBase& p_src );
65 
68 
69 };
70 
71 typedef moVector3fArray moPointArray;
72 typedef moVector3fArray moColorArray;
73 typedef moVector3fArray moColorRGBArray;
74 typedef moVector4fArray moColor4fArray;
75 typedef moVector4fArray moColorRGBAArray;
76 typedef moVector2fArray moTCoordArray;
77 typedef moVector3fArray moVertexArray;
78 typedef moVector3iArray moFaceArray;
79 typedef moMatrix3fArray moFace3Array;
80 
99 };
100 
101 
103 
104  public:
105 
106  moAttribute( void* p_buffer=NULL, long p_itemsize=0, long p_length=0 ) { buffer=p_buffer; itemsize=p_itemsize; length=p_length; }
107  virtual ~moAttribute() {}
108 
109  protected:
110 
111  void* buffer;
112  long itemsize;
113  long length;
114 
115 };
116 
117 moDeclareExportedDynamicArray( moAttribute, moAttributeArray);
118 
120 
128 
129  public:
130  moGeometry();
131  moGeometry( moGeometryType p_type );
132  virtual ~moGeometry();
133 
135  (*this) = p_src;
136  }
137  moGeometry& operator=(const moGeometry& p_src );
138  virtual MOboolean Init();
139  virtual MOboolean Init( moResourceManager* pResourceManager );
140  virtual MOboolean Finish();
141 
142  virtual float* GetVerticesBuffer();
143  virtual float* GetNormalsBuffer();
144  virtual float* GetColorBuffer();
145  virtual float* GetVerticesUVBuffer();
146 
147  virtual const moPointArray& GetVertices() const {
148  return m_Vertices;
149  }
150 
151  virtual const moPointArray& GetNormals() const {
152  return m_Normals;
153  }
154 
155  virtual const moTCoordArray& GetVerticesUV() const {
156  return m_VerticesUvs;
157  }
158 
159  virtual const moTCoordArray& GetFacesUV() const {
160  return m_FaceVertexUvs;
161  }
162 
163  virtual const moColorArray& GetColors() const {
164  return m_Colors;
165  }
166 
167 
168  virtual const moFaceArray& GetFaces() const {
169  return m_Faces;
170  }
171 
173  return m_Type;
174  }
175 
176  void applyMatrix( const moGLMatrixf &p_ModelMatrix );
177 
178  int addAttribute( const moText& p_AttributeName, moAttribute* p_attribute );
179  int removeAttribute( const moText& p_AttributeName );
180  moAttribute* getAttribute( const moText& p_AttributeName );
181 
182  static moText TypeToStr( moGeometryType p_type );
183  virtual moText ToJSON();
184 
185  public:
186 
189 
194 
199 
200  moFaceArray m_Faces;//array of triangles, 3 points referencing each an index of m_Vertices.
201  moTCoordArray m_FaceVertexUvs;//array of texture coordinates for each vertex, corresponding to each face from m_Faces
202  moAttributeArray m_Attributes;
203 };
204 
205 
207  public:
208  moPath();
209  moPath( const moVector2fArray& p_Path );
210  virtual ~moPath();
211 
212  void lineTo( float X, float Y);
213  void moveTo( float X, float Y);
214 
215  protected:
216  float offx,offy;
217  moVector2fArray m_Path;
218 
219 };
220 
221 
223 
224  public:
225 
226  moMaterialBase();
227  moMaterialBase(int p_Id, const moText& p_Name);
229  (*this) = p_src;
230  }
231  const moMaterialBase& operator = ( const moMaterialBase& p_src );
232  virtual ~moMaterialBase() {}
233 
234 
235  int m_Id;
238 
239  float m_fOpacity;
251 
256  float m_fOverdraw;
257  int m_iSides;
258 
259 };
260 
262  public:
263  moMaterial();
264  moMaterial( const moMaterial& p_src ) : moMaterialBase() {
265  (*this) = p_src;
266  }
267  const moMaterial& operator= ( const moMaterial& p_src );
268  virtual ~moMaterial() {}
269 
270 
278 
279 };
280 
281 
283  public:
284  moObject3D();
285  moObject3D(const moGeometry& p_geometry, const moMaterial& p_material ) : moSceneNode() {
286  m_Geometry = p_geometry;
287  m_Material = p_material;
288  }
289  virtual ~moObject3D() {
290 
291  }
292 
293  moObject3D( const moObject3D& p_src ) : moSceneNode() {
294  (*this) = p_src;
295  }
296 
297  moObject3D& operator=( const moObject3D& p_src ) {
298  m_Geometry = p_src.m_Geometry;
299  m_Material = p_src.m_Material;
300  m_Position = p_src.m_Position;
301  m_Scale = p_src.m_Scale;
302  m_Rotation = p_src.m_Rotation;
303  return (*this);
304  }
305 
306  void SetPosition( const moPosition& p_position ) {
307  m_Position = p_position;
308  }
309  void SetRotation( const moPosition& p_rotation ) {
310  m_Rotation = p_rotation;
311  }
312  void SetScale( const moPosition& p_scale ) {
313  m_Scale = p_scale;
314  }
315 
321 
322 };
323 
325  public:
326  moBone();
327  virtual ~moBone();
328 
329 };
330 
332  public:
333  moSprite();
334  virtual ~moSprite();
335 
336 };
337 
339  public:
340  moLine();
341  virtual ~moLine();
342 
343 };
344 
346  public:
347  moLineSegments();
348  virtual ~moLineSegments();
349 
350 };
351 
353  public:
354  moPoints();
355  virtual ~moPoints();
356 
357 };
358 
360  public:
361  moLOD();
362  virtual ~moLOD();
363 
364 };
365 
367  public:
368  moSkinnedMesh();
369  virtual ~moSkinnedMesh();
370 
371 };
372 
374  public:
375  moSkeleton();
376  virtual ~moSkeleton();
377 
378 };
379 
380 
382  public:
383  moMesh( const moGeometry& p_geometry, const moMaterial& p_material ) : moObject3D(p_geometry, p_material) {
384 
385  m_Geometry = p_geometry;
386  m_Material = p_material;
387 
388  }
389  moMesh( const moMesh& p_src ) : moObject3D( p_src ) {
390  (*this) = p_src;
391  }
392 
393  moMesh& operator=( const moMesh& p_src ) {
394  m_Geometry = p_src.m_Geometry;
395  m_Material = p_src.m_Material;
396  return (*this);
397  }
398 
399  virtual ~moMesh() {
400  }
401 
402 };
403 
405  public:
406  moShape();
407  virtual ~moShape();
408 
409 };
410 
412  public:
413  moBoxGeometry( float width=1.0, float height=1.0,float depth=1.0, int wsegments=1, int hsegments=1, int dsegments=1 );
414  virtual ~moBoxGeometry();
415 };
416 
418  public:
419  moCircleGeometry( float radius=1.0, float segments=36 );
420  virtual ~moCircleGeometry();
421 };
422 
424  public:
425  moCylinderGeometry( float radiusTop=1.0, float radiusBottom=1.0, float height=1.0, int radiusSegments=20, int heightSegments=1, int openEnded=true, float thetaStart=0, float thetaLength=moMathf::TWO_PI );
426  virtual ~moCylinderGeometry();
427 };
428 
429 
430 
431 
432 
434  public:
436  moPolyhedronGeometry( const moVector3fArray& p_Vertices, const moVector3iArray& p_Faces, float radius=1.0, float detail=0.0 );
437  virtual ~moPolyhedronGeometry();
438 };
439 
441  public:
442  moDodecahedronGeometry( float radius=1.0, float detail=0.0 );
443  virtual ~moDodecahedronGeometry();
444 };
445 
447  public:
448  moIcosahedronGeometry( float radius=1.0, float detail=0.0 );
449  virtual ~moIcosahedronGeometry();
450 };
451 
453  public:
454  moTetrahedronGeometry( float radius=1.0, float detail=0.0 );
455  virtual ~moTetrahedronGeometry();
456 };
457 
459  public:
460  moOctahedronGeometry( float radius=1.0, float detail=0.0 );
461  virtual ~moOctahedronGeometry();
462 };
463 
465  public:
466  moShapeGeometry();
467  virtual ~moShapeGeometry();
468 };
469 
471  public:
472  moPlaneGeometry( float width=1.0, float height=1.0, int widthSegments =1.0, int heightSegments =1.0 );
473  virtual ~moPlaneGeometry();
474 };
475 
477  public:
478  moExtrudeGeometry( moShapeGeometry p_shapes[], const moText& p_options );
479  virtual ~moExtrudeGeometry();
480 };
481 
483  public:
484  moRingGeometry( float innerRadius=0.5, float outerRadius=1.0, int thetaSegments=8, int phiSegments=8, float thetaStart=0.0, float thetaLength=moMathf::TWO_PI );
485  virtual ~moRingGeometry ();
486 };
487 
489  public:
490  moSphereGeometry( float radius=1.0, int widthSegments=8, int heightSegments=8, float phiStart=0.0, float phiLength=moMathf::TWO_PI, float thetaStart=0.0, float thetaLength=moMathf::PI);
491  virtual ~moSphereGeometry ();
492 };
493 
511  public:
512  moTextGeometry( const moText& p_text, const moText& parameters );
513  moTextGeometry( const moText& p_text,
514  float size = 1.0,
515  float height = 1.0,
516  int curveSegments=12,
517  const moText& font="Default",
518  const moText& weight="normal",
519  const moText& style="normal",
520  bool bevelEnabled=false,
521  int bevelThickness=10.0,
522  int bevelSize=8.0 );
523  virtual ~moTextGeometry ();
524 };
525 
534  public:
535  moTubeGeometry( const moPath& path, int segments=64, float radius=1.0, int radiusSegments=8, bool closed=false);
536  virtual ~moTubeGeometry ();
537 };
538 
539 
541  public:
542  moAxis3D( float p_size=1.0 );
543  virtual ~moAxis3D();
544 };
545 
547  public:
548  moBoundingBox3D( const moGeometry& p_geometry );
549  virtual ~moBoundingBox3D();
550 };
551 
552 
554 
558 
559  public:
560  moGuiObject();
561  virtual ~moGuiObject();
562  virtual MOboolean Init( moResourceManager* pResourceManager );
563  virtual MOboolean Finish();
564 
565  protected:
567 
568 };
569 
570 moDeclareExportedDynamicArray( moGuiObject*, moGuiObjectArray);
571 
573 
577 
578  public:
579  moWidget();
580  virtual ~moWidget();
581 
582  virtual void Draw() = 0;
583  virtual void Interaction() = 0;
584  virtual void Update() = 0;
585 
586 };
587 
589 
597 
598  public:
599  moWindow();
600  virtual ~moWindow();
601  virtual MOboolean Init( moResourceManager* pResourceManager, MOfloat x, MOfloat y, MOfloat width, MOfloat height );
602 
603  void SetInfo( moTextArray &pTexts );
604 
605  virtual void Draw();
606  virtual void Interaction();
607  virtual void Update();
608 
609  moTextArray m_Texts;
610 
615 
616 };
617 
619 
628 
629  public:
630  mo3dWidget();
631  virtual ~mo3dWidget();
632 
633  virtual void Draw();
634  virtual void Interaction();
635  virtual void Update();
636 
637 };
638 
640 
647 
648  public:
649 
650  moGUIManager();
651  virtual ~moGUIManager();
652  virtual MOboolean Init();
653  virtual MOboolean Init( MO_HANDLE p_OpHandle, MO_DISPLAY p_Display );
654  virtual MOboolean Finish();
655 
656 
657  moWindow* NewWindow( MOfloat x, MOfloat y, MOfloat width, MOfloat height, moTextHeap &textheap );
658 
659  //moWidget* GetWidget( MOint widgetid );
660 
661  void DisplayInfoWindow( MOfloat x, MOfloat y, MOfloat width, MOfloat height, moTextArray &pTexts );
662  //void DisplayGauge( MOfloat x, MOfloat y, MOfloat width, MOfloat height, MOfloat percent );
663  //void DisplayText( MOfloat x, MOfloat y, moText ptext );
664 
665  //void DisplayText( MOfloat x, MOfloat y, moText ptext );
666  //void DisplayText( MOfloat x, MOfloat y, moText ptext );
667  //void DisplayText( MOfloat x, MOfloat y, moText ptext );
668  //void DisplayText( MOfloat x, MOfloat y, moText ptext );
669 
670  void SetDisplay( MO_DISPLAY p_Display );
671  void SetOpWindowHandle( MO_HANDLE p_OpHandle );
672  void SetVisWindowHandle( MO_HANDLE p_VisHandle );
673 
674  MO_DISPLAY GetDisplay();
675  MO_HANDLE GetOpWindowHandle();
676  MO_HANDLE GetVisWindowHandle();
677 /*
678  HWND GetOpWindowHandle() { return hOpWnd; }
679  HWND GetVisWindowHandle() { return hVisWnd; }
680  */
681 
682 
683  private:
684  /*
685  HWND hOpWnd;
686  HWND hVisWnd;*/
687  MO_DISPLAY m_Display;
688  MO_HANDLE m_OpHandle;
689  MO_HANDLE m_VisHandle;
690 
691  moGuiObjectArray m_GuiObjects;
692 };
693 
694 
695 #endif /* __MO_GUIMANAGER_H__ */
moVector3f m_vLight
Definition: moGUIManager.h:250
Objeto de interface de usuario tipo ventana.
Definition: moGUIManager.h:576
moGeometryType GetType() const
Definition: moGUIManager.h:172
moVector3f moPointf
Definition: moGUIManager.h:39
float m_fTextHSegments
Definition: moGUIManager.h:249
moVector3f m_Scale
Definition: moGUIManager.h:319
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
virtual const moTCoordArray & GetVerticesUV() const
Definition: moGUIManager.h:155
float m_fTextWSegments
Definition: moGUIManager.h:248
virtual const moFaceArray & GetFaces() const
Definition: moGUIManager.h:168
virtual const moPointArray & GetVertices() const
Definition: moGUIManager.h:147
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
moVector3fArray moColorRGBArray
Definition: moGUIManager.h:73
moVertexArray m_Normals
Definition: moGUIManager.h:192
moGLMatrixf moCameraMatrix
Definition: moGUIManager.h:50
moMatrix3f moFace3
Definition: moGUIManager.h:45
moWidget 3D - objeto tridimensional
Definition: moGUIManager.h:627
#define MOboolean
Definition: moTypes.h:385
Matrices para transformaciones en Open GL.
Definition: moGLManager.h:71
moColor m_AmbientColor
Definition: moGUIManager.h:272
moVertex3f moPosition
Definition: moGUIManager.h:43
Administrador de recursos GUI.
Definition: moGUIManager.h:646
int m_iPolygonOffsetFactor
Definition: moGUIManager.h:253
moMatrix3< MOfloat > moMatrix3f
moAttribute(void *p_buffer=NULL, long p_itemsize=0, long p_length=0)
Definition: moGUIManager.h:106
virtual ~moMaterial()
Definition: moGUIManager.h:268
virtual ~moMesh()
Definition: moGUIManager.h:399
moObject3D & operator=(const moObject3D &p_src)
Definition: moGUIManager.h:297
moVector3iArray moFaceArray
Definition: moGUIManager.h:78
int m_iPolygonOffsetUnits
Definition: moGUIManager.h:254
moGLMatrixf & operator=(const moGLMatrixf &rkM)
Definition: moGLManager.cpp:68
moDeclareExportedDynamicArray(moAttribute, moAttributeArray)
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
virtual MOboolean Init()
Inicializa el objeto.
Definition: moAbstract.cpp:141
moVector3d moPointd
Definition: moGUIManager.h:40
moVertex3f moVertex
Definition: moGUIManager.h:42
moPointArray m_Vertices
Definition: moGUIManager.h:190
#define LIBMOLDEO_API
Definition: moTypes.h:180
#define MOfloat
Definition: moTypes.h:403
moAttributeArray m_Attributes
Definition: moGUIManager.h:202
virtual MOboolean Init()
Base abstracta de los objetos de interface de usuario (GUI).
Definition: moGUIManager.h:557
moResourceManager * m_pResourceManager
Definition: moGUIManager.h:566
moPolygonModes m_PolygonMode
Definition: moGUIManager.h:276
clase de para manejar textos
Definition: moText.h:75
moMesh(const moGeometry &p_geometry, const moMaterial &p_material)
Definition: moGUIManager.h:383
moMaterial m_Material
Definition: moGUIManager.h:317
moMatrix3fArray moFace3Array
Definition: moGUIManager.h:79
MOfloat m_Y
Definition: moGUIManager.h:612
moColorRGB moColor
Definition: moGUIManager.h:49
virtual void Interaction()
moVector3f m_Rotation
Definition: moGUIManager.h:320
moGeometry m_Geometry
Definition: moGUIManager.h:316
void SetScale(const moPosition &p_scale)
Definition: moGUIManager.h:312
#define MOint
Definition: moTypes.h:388
moPosition m_Center
Definition: moGUIManager.h:67
virtual const moTCoordArray & GetFacesUV() const
Definition: moGUIManager.h:159
moGeometryType
Definition: moGUIManager.h:81
moTexture * m_Map
Definition: moGUIManager.h:274
MOfloat * m_VerticesUVBuffer
Definition: moGUIManager.h:197
moColor m_Color
Definition: moGUIManager.h:273
virtual ~moCamera3D()
Definition: moGUIManager.h:59
MOfloat * m_NormalsBuffer
Definition: moGUIManager.h:196
moVector2f moTCoord
Definition: moGUIManager.h:46
virtual void Interaction()=0
moVector2fArray moTCoordArray
Definition: moGUIManager.h:76
clase base para el manejo de una textura
Definition: moTexture.h:78
moVector4f moColorRGBA
Definition: moGUIManager.h:48
Administrador de recursos.
void SetPosition(const moPosition &p_position)
Definition: moGUIManager.h:306
moVector4fArray moColorRGBAArray
Definition: moGUIManager.h:75
moMesh(const moMesh &p_src)
Definition: moGUIManager.h:389
const MOlong PI
Definition: moMath.cpp:44
MOfloat m_X
Definition: moGUIManager.h:611
virtual const moPointArray & GetNormals() const
Definition: moGUIManager.h:151
moVector3fArray moVertexArray
Definition: moGUIManager.h:77
moObject3D(const moGeometry &p_geometry, const moMaterial &p_material)
Definition: moGUIManager.h:285
virtual ~moAttribute()
Definition: moGUIManager.h:107
virtual void Update()=0
lista de textos
Definition: moText.h:306
void SetRotation(const moPosition &p_rotation)
Definition: moGUIManager.h:309
moColorArray m_Colors
Definition: moGUIManager.h:193
float m_fWireframeWidth
Definition: moGUIManager.h:247
The Y component of space.
Definition: moOGLFT.h:78
Base abstracta de base para las geometrías.
Definition: moGUIManager.h:127
MOfloat * m_VerticesBuffer
Definition: moGUIManager.h:195
moVector3i moFace
Definition: moGUIManager.h:44
virtual MOboolean Finish()
moVector3fArray moPointArray
Definition: moGUIManager.h:71
MOfloat m_Width
Definition: moGUIManager.h:613
The X component of space.
Definition: moOGLFT.h:77
virtual void Update()
MOfloat m_Height
Definition: moGUIManager.h:614
virtual void Draw(moEffectState *state, GLuint g_ViewMode)
MOfloat * m_ColorBuffer
Definition: moGUIManager.h:198
virtual ~moObject3D()
Definition: moGUIManager.h:289
moTCoordArray m_VerticesUvs
Definition: moGUIManager.h:191
const moMaterialBase & operator=(const moMaterialBase &p_src)
float offy
Definition: moGUIManager.h:216
moBlendingModes m_Blending
Definition: moGUIManager.h:277
moMatrix3 & operator=(const moMatrix3 &rkM)
moPosition m_Position
Definition: moGUIManager.h:318
moTextArray m_Texts
Definition: moGUIManager.h:609
moVertex3f moColorRGB
Definition: moGUIManager.h:47
moMesh & operator=(const moMesh &p_src)
Definition: moGUIManager.h:393
moMaterialBase(const moMaterialBase &p_src)
Definition: moGUIManager.h:228
moColor m_SpecularColor
Definition: moGUIManager.h:271
const MOlong TWO_PI
Definition: moMath.cpp:45
moPointf moPoint
Definition: moGUIManager.h:41
moGeometry(const moGeometry &p_src)
Definition: moGUIManager.h:134
Ventana simple.
Definition: moGUIManager.h:596
moGLMatrixf moCamera3DBase
Definition: moGUIManager.h:51
virtual void Draw()=0
moText m_Name
Definition: moGUIManager.h:187
moVector2fArray m_Path
Definition: moGUIManager.h:217
moTCoordArray m_FaceVertexUvs
Definition: moGUIManager.h:201
moPosition m_Position
Definition: moGUIManager.h:66
void * buffer
Definition: moGUIManager.h:111
moMaterial(const moMaterial &p_src)
Definition: moGUIManager.h:264
moObject3D(const moObject3D &p_src)
Definition: moGUIManager.h:293
moPolygonModes
Modos de dibujado de polígonos.
Definition: moTypes.h:472
moFaceArray m_Faces
Definition: moGUIManager.h:200
MOint m_MapGLId
Definition: moGUIManager.h:275
virtual const moColorArray & GetColors() const
Definition: moGUIManager.h:163
virtual ~moMaterialBase()
Definition: moGUIManager.h:232
moVector4fArray moColor4fArray
Definition: moGUIManager.h:74
moBlendingModes
Modos de combinación
Definition: moTypes.h:453
moGeometryType m_Type
Definition: moGUIManager.h:188
moVector3fArray moColorArray
Definition: moGUIManager.h:72
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )