23 #include "worldsimconfig.h"
25 #include "resourcesuser.h"
27 #include "qglviewer/qglviewer.h"
39 class RenderWObjectContainer;
56 this->contain = container;
59 virtual void render( QGLContext* gw ) = 0;
90 UNUSED_PARAM( dimension );
113 virtual void objectAlreadyDestroyed()
144 return (
new T(wobj, container) );
173 void setWorld(
World* newworld );
176 return (*textmap)[texture];
185 bool addTextureImage( QString filename, QString texturename );
196 template<
class renderw
object>
202 void applyTexture( QGLContext* gw, QString texts );
206 void drawSkyGroundBox( QGLContext* );
208 static void drawSphere(
wVector pos, real radius );
210 static void drawCylinder(
wVector axis,
wVector centre,
float len,
float radius, QColor c = Qt::green );
212 static void drawCylinder(
wVector start,
wVector end,
float radius, QColor c = Qt::green );
214 static void drawCylinder(
const wMatrix& mat,
float len,
float radius, QColor c = Qt::green );
222 static void drawTorus( real outRad, real innRad,
const wMatrix& mat, real angle = 2.0*PI_GRECO, QColor c=Qt::red );
224 static void drawTorus(
wVector axis,
wVector centre, real outRad, real innRad, real angle = 2.0*PI_GRECO );
251 virtual void resourceChanged(QString name, ResourceChangeType changeType);
257 const QString worldResourceName;
261 QVector<RenderWObject*> graphs;
263 static QMap<QString, WAbstractCreator*>* fac;
265 static bool facInited;
267 static void initFactory();
269 static QMap<QString, QImage> *textmap;
275 static unsigned int textmapRefCounter;
277 QMap<QString, GLuint> textGLId;
296 RenderWorld( QWidget* parent = NULL, QString wResName =
"world" );
300 void drawArrow(
const wVector& from,
const wVector& to,
float radius=-1,
int nbSubdivisions=12, QColor c = Qt::red );
303 void wireframe(
bool b );
305 void showSkyGround(
bool b );
307 void showObjects(
bool b );
309 void showJoints(
bool b );
311 void showAABBs(
bool b );
313 void showContacts(
bool b );
315 void showForces(
bool b );
317 void contextMenu(
const QPoint& );
320 void slotAddObject(
WObject* );
322 void slotRemoveObject(
WObject* );
324 void onWorldResize();
331 virtual void drawWithNames();
333 virtual void postSelection(
const QPoint& point);
335 virtual void keyPressEvent(QKeyEvent *e);
363 virtual void customEvent(QEvent* event);
369 void drawDOF(
PhyDOF* dof,
bool );
371 void drawKineChains();
376 bool showskygroundbox;