Browse Source

Add `createGridWarpSurface` method

master
Krisjanis Rijnieks 9 years ago
parent
commit
be0c0184d6
  1. 7
      src/Surfaces/SurfaceFactory.cpp
  2. 2
      src/Surfaces/SurfaceFactory.h

7
src/Surfaces/SurfaceFactory.cpp

@ -17,6 +17,8 @@ BaseSurface * SurfaceFactory::createSurface(int type){
return createTriangleSurface();
}else if(type == SurfaceType::QUAD_SURFACE){
return createQuadSurface();
}else if(type == SurfaceType::GRID_WARP_SURFACE){
return createGridWarpSurface();
}else{
throw runtime_error("Undefined surface type");
}
@ -68,5 +70,10 @@ QuadSurface * SurfaceFactory::createQuadSurface(){
return quadSurface;
}
GridWarpSurface * SurfaceFactory::createGridWarpSurface(){
GridWarpSurface * gridWarpSurface = new GridWarpSurface();
return gridWarpSurface;
}
} // namespace piMapper
} // namespace ofx

2
src/Surfaces/SurfaceFactory.h

@ -5,6 +5,7 @@
#include "SurfaceType.h"
#include "TriangleSurface.h"
#include "QuadSurface.h"
#include "GridWarpSurface.h"
namespace ofx {
namespace piMapper {
@ -22,6 +23,7 @@ class SurfaceFactory {
TriangleSurface * createTriangleSurface();
QuadSurface * createQuadSurface();
GridWarpSurface * createGridWarpSurface();
};
} // namespace piMapper

Loading…
Cancel
Save