Commit def68969 authored by David E. DeMarle's avatar David E. DeMarle
Browse files

setting up infrastructure

this runs and does not crash, but does not render anything
parent 381242c8
......@@ -6,6 +6,7 @@ set(classes
vtkOSPRayLightNode
vtkOSPRayMaterialHelpers
vtkOSPRayMaterialLibrary
vtkOSPRayMoleculeMapperNode
vtkOSPRayPass
vtkOSPRayPolyDataMapperNode
vtkOSPRayRendererNode
......
......@@ -6,6 +6,7 @@ IMPLEMENTS
VTK::RenderingVolume
DEPENDS
VTK::CommonDataModel
VTK::DomainsChemistry
VTK::RenderingCore
VTK::RenderingOpenGL2
VTK::RenderingSceneGraph
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOSPRayMoleculeMapperNode.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkOSPRayMoleculeMapperNode.h"
#include "vtkInformation.h"
#include "vtkMolecule.h"
#include "vtkMoleculeMapper.h"
#include "vtkOSPRayCache.h"
#include "vtkOSPRayRendererNode.h"
#include "vtkObjectFactory.h"
#include "vtkRenderer.h"
#include <algorithm>
#include <vector>
//============================================================================
vtkStandardNewMacro(vtkOSPRayMoleculeMapperNode);
//----------------------------------------------------------------------------
vtkOSPRayMoleculeMapperNode::vtkOSPRayMoleculeMapperNode()
{
cerr << "CREATE OSPMOLMAPPERNODE " << this << endl;
}
//----------------------------------------------------------------------------
vtkOSPRayMoleculeMapperNode::~vtkOSPRayMoleculeMapperNode()
{
cerr << "DESTROY OSPMOLMAPPERNODE " << this << endl;
delete this->Cache;
}
//----------------------------------------------------------------------------
void vtkOSPRayMoleculeMapperNode::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkOSPRayMoleculeMapperNode::Render(bool prepass)
{
if (prepass)
{
vtkMoleculeMapper* mapper = vtkMoleculeMapper::SafeDownCast(this->GetRenderable());
vtkOSPRayRendererNode* orn =
static_cast<vtkOSPRayRendererNode*>(this->GetFirstAncestorOfType("vtkOSPRayRendererNode"));
vtkRenderer* ren = vtkRenderer::SafeDownCast(orn->GetRenderable());
RTW::Backend* backend = orn->GetBackend();
if (backend == nullptr)
{
return;
}
OSPModel OSPRayModel = orn->GetOModel();
}
else
{
}
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOSPRayMoleculeMapperNode.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkOSPRayMoleculeMapperNode
* @brief links vtkMoleculeMapper to OSPRay
*
* Translates vtkMoleculeMapper state into OSPRay rendering calls
*/
#ifndef vtkOSPRayMoleculeMapperNode_h
#define vtkOSPRayMoleculeMapperNode_h
#include "vtkOSPRayCache.h" // For common cache infrastructure
#include "vtkPolyDataMapperNode.h"
#include "vtkRenderingRayTracingModule.h" // For export macro
#include "RTWrapper/RTWrapper.h" // for handle types
class VTKRENDERINGRAYTRACING_EXPORT vtkOSPRayMoleculeMapperNode : public vtkPolyDataMapperNode
{
public:
static vtkOSPRayMoleculeMapperNode* New();
vtkTypeMacro(vtkOSPRayMoleculeMapperNode, vtkPolyDataMapperNode);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Make ospray calls to render me.
*/
virtual void Render(bool prepass) override;
protected:
vtkOSPRayMoleculeMapperNode();
~vtkOSPRayMoleculeMapperNode() override;
vtkOSPRayCache<vtkOSPRayCacheItemObject>* Cache;
private:
vtkOSPRayMoleculeMapperNode(const vtkOSPRayMoleculeMapperNode&) = delete;
void operator=(const vtkOSPRayMoleculeMapperNode&) = delete;
};
#endif
......@@ -20,6 +20,7 @@
#include "vtkOSPRayCameraNode.h"
#include "vtkOSPRayCompositePolyDataMapper2Node.h"
#include "vtkOSPRayLightNode.h"
#include "vtkOSPRayMoleculeMapperNode.h"
#include "vtkOSPRayPolyDataMapperNode.h"
#include "vtkOSPRayRendererNode.h"
#include "vtkOSPRayTetrahedraMapperNode.h"
......@@ -67,6 +68,12 @@ vtkViewNode* pd_maker()
return vn;
}
vtkViewNode* molecule_maker()
{
vtkOSPRayMoleculeMapperNode* vn = vtkOSPRayMoleculeMapperNode::New();
return vn;
}
vtkViewNode* vm_maker()
{
vtkOSPRayVolumeMapperNode* vn = vtkOSPRayVolumeMapperNode::New();
......@@ -110,7 +117,8 @@ vtkOSPRayViewNodeFactory::vtkOSPRayViewNodeFactory()
this->RegisterOverride("vtkOpenGLProjectedTetrahedraMapper", tetm_maker);
this->RegisterOverride("vtkUnstructuredGridVolumeZSweepMapper", tetm_maker);
this->RegisterOverride("vtkUnstructuredGridVolumeRayCastMapper", tetm_maker);
this->RegisterOverride("vtkAMRVolumeMapper", amrm_maker);
this->RegisterOverride("vtkMoleculeMapper", molecule_maker);
this->RegisterOverride("vtkMoleculeMapper", molecule_maker);
}
//----------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment