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;
113 virtual void objectAlreadyDestroyed()
151 return (
new T(wobj, container) );
180 void setWorld(
World* newworld );
183 return (*textmap)[texture];
192 static bool addTextureImage( QString filename, QString texturename );
203 template<
class renderw
object>
209 void applyTexture( QGLContext* gw, QString texts );
213 void drawSkyGroundBox( QGLContext* );
215 static void drawSphere(
wVector pos,
real radius );
217 static void drawCylinder(
wVector axis,
wVector centre,
float len,
float radius, QColor c = Qt::green );
219 static void drawCylinder(
wVector start,
wVector end,
float radius, QColor c = Qt::green );
221 static void drawCylinder(
const wMatrix& mat,
float len,
float radius, QColor c = Qt::green );
223 static void drawCone(
const wMatrix& mat,
float len,
float radius, QColor c = Qt::green );
225 static void drawArrow(
const wVector& direction,
const wVector& start,
float radius,
float tipRadius,
float tipLength, QColor c = Qt::green );
233 static void drawTorus(
real outRad,
real innRad,
const wMatrix& mat,
real angle = 2.0*PI_GRECO, QColor c=Qt::red );
262 virtual void resourceChanged(QString name, ResourceChangeType changeType);
269 static void initializeTextmap();
271 const QString worldResourceName;
275 QVector<RenderWObject*> graphs;
277 static QMap<QString, WAbstractCreator*>* fac;
279 static bool facInited;
281 static void initFactory();
283 static QMap<QString, QImage>* textmap;
289 static unsigned int textmapRefCounter;
291 static QMutex textmapMutex;
293 QMap<QString, GLuint> textGLId;
312 RenderWorld( QWidget* parent = NULL, QString wResName =
"world" );
316 void drawArrow(
const wVector& from,
const wVector& to,
float radius=-1,
int nbSubdivisions=12, QColor c = Qt::red );
319 void wireframe(
bool b );
321 void showSkyGround(
bool b );
323 void showObjects(
bool b );
325 void showJoints(
bool b );
327 void showAABBs(
bool b );
329 void showContacts(
bool b );
331 void showForces(
bool b );
333 void showLocalAxes(
bool b );
335 void showLabels(
bool b );
337 void showTimeAndStep(
bool b );
339 void contextMenu(
const QPoint& );
342 void slotAddObject(
WObject* );
344 void slotRemoveObject(
WObject* );
346 void onWorldResize();
353 virtual void drawWithNames();
355 virtual void postSelection(
const QPoint& point);
357 virtual void keyPressEvent(QKeyEvent *e);
385 virtual void customEvent(QEvent* event);
391 void drawDOF(
PhyDOF* dof,
bool );
393 void drawKineChains();
398 bool showskygroundbox;
414 bool showtimeandstep;