106 return pResourceManager!=NULL;
125 result =
moText(
"PointGeometry");
128 result =
moText(
"CircleGeometry");
131 result =
moText(
"CylinderGeometry");
134 result =
moText(
"DodecahedronGeometry");
137 result =
moText(
"ExtrudeGeometry");
140 result =
moText(
"IcosahedronGeometry");
143 result =
moText(
"PlaneGeometry");
146 result =
moText(
"PolyhedronGeometry");
149 result =
moText(
"RingGeometry");
152 result =
moText(
"ShapeGeometry");
155 result =
moText(
"SphereGeometry");
158 result =
moText(
"TetrahedronGeometry");
161 result =
moText(
"TextGeometry");
164 result =
moText(
"TubeGeometry");
167 result =
moText(
"BoxGeometry");
171 result =
moText(
"undefined Geometry");
190 JSON+=
"',vertices': [";
204 JSON+=
"'verticesBuffer': [";
228 if (
m_Faces.Count()==0)
return NULL;
241 for(
int pi=0; pi<3; pi++ ) {
244 int indexv3 = fi*9+pi*3;
245 int indexv2 = fi*6+pi*2;
300 wsegments = max( 1, wsegments );
301 hsegments = max( 1, hsegments );
302 dsegments = max( 1, dsegments );
303 int vertexCount = ( wsegments * hsegments * 2 ) + ( wsegments * dsegments * 2 ) + ( wsegments * hsegments * 2 );
335 float px=0.0f,py=0.0f,pz = 0.0f;
337 float u=0.0f, v=0.0f, w = -0.5f + (float)fk / (
float)dsegments ;
339 for (
int j = 0; j <= hsegments; j++ ) {
341 v = -0.5f + (float)j / (
float)hsegments;
343 for (
int i = 0; i <= wsegments; i++ ) {
345 u = -0.5f + (float)i / (
float)wsegments;
363 position.
Z() = w + 1.0f;
364 normal.
Z() = w + 1.0f;
370 if ( j>0 && (i%2)==0) {
371 ixline = index - (j-1)*wsegments;
374 if ( j>0 && (i%2)==1) {
375 ixline = index - (j-1)*wsegments;
382 for (
int k = 0; k <= dsegments; k++ ) {
384 w = -0.5f + (float)k / (
float)dsegments;
386 for (
int i = 0; i <= wsegments; i++ ) {
388 u = -0.5f + (float)i / (
float)wsegments;
406 position.
X() = u + 1.0f;
407 normal.
X() = u + 1.0f;
413 if ( k>0 && (i%2)==0) {
414 ixline = index - (k-1)*wsegments;
417 if ( k>0 && (i%2)==1) {
418 ixline = index - (k-1)*wsegments;
426 for (
int k = 0; k <= dsegments; k++ ) {
428 w = -0.5f + (float)k / (
float)dsegments;
430 for (
int j = 0; j <= hsegments; j++ ) {
432 v = -0.5f + (float)j / (
float)hsegments;
450 position.
X() = u + 1.0f;
451 normal.
X() = u + 1.0f;
457 if ( k>0 && (k%2)==0) {
458 ixline = index - (k-1)*wsegments;
461 if ( k>0 && (j%2)==1) {
462 ixline = index - (k-1)*wsegments;
536 float dw = 0.5*width;
537 float dh = 0.5*height;
629 const moVector3iArray& p_Faces,
663 widthSegments = max( 3, widthSegments );
664 heightSegments = max( 2, heightSegments );
665 int vertexCount = ( ( widthSegments + 1 ) * ( heightSegments + 1 ) );
696 float thetaEnd = thetaStart + thetaLength;
697 for (
int j = 0; j <= heightSegments; j++ ) {
699 float v = (float)j / (
float)heightSegments;
701 for (
int i = 0; i <= widthSegments; i++ ) {
703 float u = ((float)i) / ((float)widthSegments);
706 float py = radius *
moMathf::Cos( thetaStart + v * thetaLength );
720 for (
int j = 0; j < heightSegments; j ++ ) {
722 for (
int i = 0; i < widthSegments; i ++ ) {
724 int i1 = j*(widthSegments+1) + i + 1;
725 int i2 = j*(widthSegments+1) + i;
726 int i3 = (j + 1)*(widthSegments+1) + i;
727 int i4 = (j + 1)*(widthSegments+1) + i + 1;
729 if ( j != 0 || thetaStart > 0 ) {
732 if ( j != heightSegments - 1 || thetaEnd <
moMathf::PI ) {
992 m_OpHandle = (MO_HANDLE) NULL;
993 m_VisHandle = (MO_HANDLE) NULL;
1049 textheap.
Push(
"NewWindow");
1071 m_Display = p_Display;
1078 m_OpHandle = p_OpHandle;
1085 m_VisHandle = p_VisHandle;
1189 for(i=0; i<pTexts.Count(); i++) {
1198 glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
1200 glBindTexture( GL_TEXTURE_2D, 0 );
1201 glColor4f( 0.3, 0.3, 0.3, 0.75 );
1205 glTexCoord2f( 0, 0);
1208 glTexCoord2f( 0, 1);
1211 glTexCoord2f( 1, 1);
1214 glTexCoord2f( 1, 0);
1226 glColor4f( 1.0, 1.0, 1.0, 1.0 );
1228 glScalef( size, size, size);
virtual ~moSphereGeometry()
void SetVisWindowHandle(MO_HANDLE p_VisHandle)
virtual float * GetVerticesUVBuffer()
virtual float * GetColorBuffer()
moBoxGeometry(float width=1.0, float height=1.0, float depth=1.0, int wsegments=1, int hsegments=1, int dsegments=1)
void SetName(const moText &p_name)
void SetOpWindowHandle(MO_HANDLE p_OpHandle)
clase base para una fuente 3d o 2d
MO_HANDLE GetVisWindowHandle()
void SetInfo(moTextArray &pTexts)
LIBMOLDEO_API moText0 FloatToStr(double a)
Matrices para transformaciones en Open GL.
virtual float * GetVerticesBuffer()
moFontManager * GetFontMan()
int m_iPolygonOffsetFactor
moWindow * NewWindow(MOfloat x, MOfloat y, MOfloat width, MOfloat height, moTextHeap &textheap)
void SetResourceType(moResourceType p_restype)
static Real Sin(Real fValue)
virtual MOboolean Init(moResourceManager *pResourceManager, MOfloat x, MOfloat y, MOfloat width, MOfloat height)
int m_iPolygonOffsetUnits
void SetDisplay(MO_DISPLAY p_Display)
virtual MOboolean Init()
Inicializa el objeto.
static moText TypeToStr(moGeometryType p_type)
moVector2< MOfloat > moVector2f
moResourceManager * m_pResourceManager
moPolygonModes m_PolygonMode
clase de para manejar textos
virtual MOboolean Finish()
moResourceManager * m_pResourceManager
Puntero al administrador de recursos.
Dispositivo de entrada/salida, típicamente, interfaces humanas de IO y datos ( teclado, mouse, tableta, tcp, udp, serial )
moGLMatrixf & MakeIdentity()
moGLMatrixf m_ModelMatrix
virtual void SetResourceManager(moResourceManager *p_rm)
const moMaterial & operator=(const moMaterial &p_src)
MOfloat * m_VerticesUVBuffer
MOfloat * m_NormalsBuffer
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Administrador de recursos.
void SetLabelName(const moText &p_labelname)
void Draw(MOfloat x, MOfloat y, moText &text)
void Push(const moText &p_text)
Base abstracta de base para las geometrías.
static moDebug * MODebug2
Clase de impresión de errores para depuración
MOfloat * m_VerticesBuffer
static Real Cos(Real fValue)
moCamera3D & operator=(const moCamera3D &p_src)
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)
void applyMatrix(const moGLMatrixf &p_ModelMatrix)
moGeometry & operator=(const moGeometry &p_src)
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
moPlaneGeometry(float width=1.0, float height=1.0, int widthSegments=1.0, int heightSegments=1.0)
moTCoordArray m_VerticesUvs
const moMaterialBase & operator=(const moMaterialBase &p_src)
virtual MOboolean Init()
Inicializa el objeto.
moBlendingModes m_Blending
virtual ~moPlaneGeometry()
moVector3< MOfloat > moVector3f
virtual ~moPolyhedronGeometry()
MO_HANDLE GetOpWindowHandle()
MOboolean m_bInitialized
Valor de inicialización
moTCoordArray m_FaceVertexUvs
void DisplayInfoWindow(MOfloat x, MOfloat y, MOfloat width, MOfloat height, moTextArray &pTexts)
virtual void Interaction()
void Message(moText p_text)
Anuncia un mensaje al usuario además de guardarlo en el log de texto.
void SetType(moMoldeoObjectType p_type)
virtual float * GetNormalsBuffer()
moDefineDynamicArray(moGuiObjectArray) moDefineDynamicArray(moAttributeArray) moCamera3D