First opengl/x11/window integration.
This commit is contained in:
parent
7c6a92f4ec
commit
cea3d2c39f
30 changed files with 254 additions and 72 deletions
|
@ -0,0 +1,54 @@
|
|||
#include "Scene.h"
|
||||
|
||||
#include "VisualLayer.h"
|
||||
#include "GeometryNode.h"
|
||||
#include "RectangleNode.h"
|
||||
|
||||
#include "MeshBuilder.h"
|
||||
#include "TriMesh.h"
|
||||
|
||||
void Scene::syncLayers(const std::vector<VisualLayer*>& layers)
|
||||
{
|
||||
mLayers = layers;
|
||||
}
|
||||
|
||||
void Scene::update(Image<unsigned char>* image)
|
||||
{
|
||||
if (image)
|
||||
{
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
mWorkingMeshs.clear();
|
||||
for(auto layer : mLayers)
|
||||
{
|
||||
if (layer->hasShapeNode())
|
||||
{
|
||||
auto node = layer->getShapeNode();
|
||||
if (layer->getIsDirty())
|
||||
{
|
||||
node->updateMesh();
|
||||
layer->setIsDirty(false);
|
||||
}
|
||||
|
||||
mWorkingMeshs.push_back(dynamic_cast<TriMesh*>(node->getMesh()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::processRectangleNode(RectangleNode* node)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
unsigned Scene::getNumMeshes() const
|
||||
{
|
||||
return mWorkingMeshs.size();
|
||||
}
|
||||
|
||||
TriMesh* Scene::getMesh(std::size_t idx) const
|
||||
{
|
||||
return mWorkingMeshs[idx];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue