Cleaning for opengl rendering prep.
This commit is contained in:
parent
402f381d10
commit
7c6a92f4ec
58 changed files with 570 additions and 533 deletions
|
@ -1,43 +1,53 @@
|
|||
#include "DrawingContext.h"
|
||||
|
||||
#include "INativeDrawingContext.h"
|
||||
#include "AbstractGeometricItem.h"
|
||||
#include "AbstractPainter.h"
|
||||
#include "OpenGlPainter.h"
|
||||
#include "RasterPainter.h"
|
||||
#include "DrawingSurface.h"
|
||||
#include "Scene.h"
|
||||
#include "Grid.h"
|
||||
|
||||
#include "MeshBuilder.h"
|
||||
|
||||
#include "TriMesh.h"
|
||||
|
||||
std::unique_ptr<DrawingContext> DrawingContext::Create()
|
||||
DrawingContext::DrawingContext(DrawingSurface* surface, DrawingMode requestedDrawingMode)
|
||||
: mSurface(surface),
|
||||
mDrawingMode(requestedDrawingMode),
|
||||
mScene(std::make_unique<Scene>())
|
||||
{
|
||||
return std::make_unique<DrawingContext>();
|
||||
if (mDrawingMode == DrawingMode::GRAPH)
|
||||
{
|
||||
mPainter = std::make_unique<OpenGlPainter>();
|
||||
}
|
||||
else
|
||||
{
|
||||
mPainter = std::make_unique<RasterPainter>();
|
||||
}
|
||||
}
|
||||
|
||||
void DrawingContext::setNativeContext(std::unique_ptr<INativeDrawingContext> context)
|
||||
std::unique_ptr<DrawingContext> DrawingContext::Create(DrawingSurface* surface, DrawingMode requestedDrawingMode)
|
||||
{
|
||||
mNativeDrawingContext = std::move(context);
|
||||
}
|
||||
|
||||
INativeDrawingContext* DrawingContext::getNativeContext()
|
||||
{
|
||||
return mNativeDrawingContext.get();
|
||||
}
|
||||
|
||||
void DrawingContext::addDrawable(AbstractGeometricItemPtr item)
|
||||
{
|
||||
mItems.push_back(std::move(item));
|
||||
}
|
||||
|
||||
unsigned DrawingContext::getNumItems() const
|
||||
{
|
||||
return mItems.size();
|
||||
}
|
||||
|
||||
AbstractGeometricItem* DrawingContext::getDrawable(unsigned idx) const
|
||||
{
|
||||
return mItems[idx].get();
|
||||
return std::make_unique<DrawingContext>(surface, requestedDrawingMode);
|
||||
}
|
||||
|
||||
void DrawingContext::updateMesh()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Scene* DrawingContext::getScene() const
|
||||
{
|
||||
return mScene.get();
|
||||
}
|
||||
|
||||
DrawingSurface* DrawingContext::getSurface() const
|
||||
{
|
||||
return mSurface;
|
||||
}
|
||||
|
||||
void DrawingContext::paint()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue