Base class for drawers capable of drawing Geometry. A derived MeshDrawer should be registered by the module. The MeshDrawerFactory can be used to get a drawer without knowing the type of Geometry. This is enabled by implementing the abstract functions canRender and create.
Example of how to implement a derived MeshDrawer.
class IVW_XXX_API DerivedDrawer: public MeshDrawer {
public:
DerivedDrawer(const DerivedMesh* g): MeshDrawer(), geomToRender_(g) {};
}
virtual const Mesh*
getMesh()
const {
return geomToRender_; }
protected:
virtual DerivedDrawer*
create(
const Mesh* geom)
const {
return new DerivedDrawer(static_cast<const DerivedMesh*>(geom));
}
virtual bool canRender(const Mesh* geom) const {
return dynamic_cast<const DerivedMesh*>(geom) != nullptr;
}
private:
const DerivedMesh* geomToRender_;
};
- See also
- Geometry
-
MeshDrawerFactory
-
Module