Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
stock_resources.hpp
1 // Copyright [2015] Albert Huang
2 
3 #ifndef SCENEVIEW_STOCK_RESOURCES_HPP_
4 #define SCENEVIEW_STOCK_RESOURCES_HPP_
5 
6 #include <memory>
7 #include <sceneview/geometry_resource.hpp>
8 #include <sceneview/resource_manager.hpp>
9 #include <sceneview/drawable.hpp>
10 
11 namespace sv {
12 
21 extern const QString kColor;
22 
26 extern const QString kDiffuse;
27 
31 extern const QString kSpecular;
32 
36 extern const QString kShininess;
37 
41 extern const QString kTexture0;
42 
87  public:
228  kBillboardTextured,
229  kBillboardUniformColor
230  };
231 
232  public:
236  explicit StockResources(const ResourceManager::Ptr& resources);
237 
245  GeometryResource::Ptr Cone();
246 
253  GeometryResource::Ptr Cube();
254 
262  GeometryResource::Ptr Cylinder();
263 
270  GeometryResource::Ptr Sphere();
271 
288  Drawable::Ptr UnitAxes();
289 
294  ShaderResource::Ptr Shader(StockShaderId id);
295 
307  MaterialResource::Ptr NewMaterial(StockShaderId id);
308 
316  static GeometryData ConeData();
317 
324  static GeometryData CubeData();
325 
334  static GeometryData CylinderData();
335 
340  static GeometryData SphereData();
341 
345  static GeometryData UnitAxesData();
346 
347  private:
348  ResourceManager::Ptr resources_;
349 };
350 
355 } // namespace sv
356 
357 #endif // SCENEVIEW_STOCK_RESOURCES_HPP_
const QString kColor
String constant parameter name used by some stock shaders.
const QString kTexture0
String constant parameter name used by the texture stock shaders.
GeometryResource::Ptr Cube()
Retrieves the stock cone geometry resource.
ShaderResource::Ptr Shader(StockShaderId id)
Retrieve the shader resource corresponding to the specified stock shader.
Like kUniformColorLighting with the addition of a texture map.
Definition: stock_resources.hpp:227
StockResources(const ResourceManager::Ptr &resources)
Constructor.
Geometry description to be used with GeometryResource.
Definition: geometry_resource.hpp:30
static GeometryData ConeData()
Generate geometry data for a cone.
Color is specified on a per-vertex basis, with no lighting calculations.
Definition: stock_resources.hpp:138
Functions to generate stock resources.
Definition: stock_resources.hpp:86
Uses the stock lighting model with identical colors for all vertices.
Definition: stock_resources.hpp:131
Like kUniformColorNoLighting with the addition of a texture map.
Definition: stock_resources.hpp:223
Drawable::Ptr UnitAxes()
Stock unit axes, with:
static GeometryData CylinderData()
Generate geometry data for a cylinder that fits in a unit cube centered on the origin.
const QString kShininess
String constant parameter name used by some stock shaders.
static GeometryData CubeData()
Generate geometry data for a unit cube.
MaterialResource::Ptr NewMaterial(StockShaderId id)
Convenience method that makes a new material attached to a stock shader.
GeometryResource::Ptr Cone()
Retrieves the stock cone geometry resource.
Color is identical for all vertices, and there is no lighting.
Definition: stock_resources.hpp:108
StockShaderId
Definition: stock_resources.hpp:88
static GeometryData SphereData()
Generate geometry data for a sphere of diameter 1 centered at the origin.
const QString kSpecular
String constant parameter name used by some stock shaders.
Uses the stock lighting model with colors specified on a per-vertex basis.
Definition: stock_resources.hpp:175
GeometryResource::Ptr Sphere()
Retrieve the stock sphere geometry resource.
static GeometryData UnitAxesData()
Generate geometry data for a set of unit axes.
const QString kDiffuse
String constant parameter name used by some stock shaders.
GeometryResource::Ptr Cylinder()
Retrieve the stock cylinder geometry resource.