Commit 68b85ef5 authored by Aron Helser's avatar Aron Helser

Fixes for compiling opencascade on msvc2019

parent aa9e6b4c
......@@ -101,37 +101,37 @@ Shape* Operation::createNode(
switch (shapeType)
{
case TopAbs_COMPOUND:
node = resource->create<Compound>();
node = resource->createShape<Compound>();
break;
case TopAbs_COMPSOLID:
mark = false;
node = resource->create<CompSolid>();
node = resource->createShape<CompSolid>();
break;
case TopAbs_SOLID:
mark = false;
node = resource->create<Solid>();
node = resource->createShape<Solid>();
break;
case TopAbs_SHELL:
mark = false;
node = resource->create<Shell>();
node = resource->createShape<Shell>();
break;
case TopAbs_FACE:
node = resource->create<Face>();
node = resource->createShape<Face>();
break;
case TopAbs_WIRE:
mark = false;
node = resource->create<Wire>();
node = resource->createShape<Wire>();
break;
case TopAbs_EDGE:
node = resource->create<Edge>();
node = resource->createShape<Edge>();
break;
case TopAbs_VERTEX:
node = resource->create<Vertex>();
node = resource->createShape<Vertex>();
break;
case TopAbs_SHAPE: // fall through
default:
mark = false;
node = resource->create<Shape>();
node = resource->createShape<Shape>();
break;
}
std::string nname;
......
......@@ -10,7 +10,6 @@
#ifndef smtk_session_opencascade_Resource_h
#define smtk_session_opencascade_Resource_h
/*!\file */
#include "smtk/graph/Resource.h"
#include "smtk/resource/DerivedFrom.h"
......@@ -26,6 +25,7 @@ namespace smtk
{
namespace session
{
/// OpenCASCADE session
namespace opencascade
{
......@@ -41,15 +41,16 @@ class Shape;
struct CellBoundary;
struct FreeCell;
using GraphResource = smtk::graph::Resource<Traits>;
/**\brief A resource for boundary representations via OpenCASCADE.
*
*/
class SMTKOPENCASCADESESSION_EXPORT Resource
: public smtk::resource::DerivedFrom<Resource, smtk::graph::Resource<Traits> >
: public smtk::resource::DerivedFrom<smtk::session::opencascade::Resource, GraphResource>
{
public:
smtkTypeMacro(smtk::session::opencascade::Resource);
smtkSuperclassMacro(smtk::resource::DerivedFrom<Resource, smtk::graph::Resource<Traits> >);
smtkSuperclassMacro(smtk::resource::DerivedFrom<Resource, GraphResource>);
smtkSharedPtrCreateMacro(smtk::resource::PersistentObject);
virtual ~Resource() = default;
......@@ -62,7 +63,12 @@ public:
const TopoDS_Compound& compound() const { return m_compound; }
void setCompound(const TopoDS_Compound& compound) { m_compound = compound; }
using Superclass::create;
// wrap to avoid name conflict in msvc
template <typename componentT>
smtk::shared_ptr<componentT> createShape()
{
return GraphResource::create<componentT>();
}
protected:
Resource(const smtk::common::UUID&, smtk::resource::Manager::Ptr manager = nullptr);
......
......@@ -117,7 +117,7 @@ Cut::Result Cut::operateInternal()
else
{
std::cerr << "Grrk! unknown shape marked modified.\n";
auto topNode = resource->create<Shape>();
auto topNode = resource->createShape<Shape>();
session->addShape(topNode->id(), *shapeIn);
created->appendValue(topNode);
geom.markModified(topNode);
......@@ -133,7 +133,7 @@ Cut::Result Cut::operateInternal()
std::size_t ii = 0;
for (auto& shape : newShapes)
{
auto topNode = resource->create<Shape>();
auto topNode = resource->createShape<Shape>();
session->addShape(topNode->id(), shape);
created->appendValue(topNode);
geom.markModified(topNode);
......
......@@ -29,7 +29,7 @@ namespace opencascade
/**\brief Identify b-rep components highlighted to display a selection.
*
*/
struct SMTKCORE_EXPORT SelectionFootprint
struct SMTKOPENCASCADESESSION_EXPORT SelectionFootprint
: public smtk::resource::query::DerivedFrom<SelectionFootprint,
smtk::geometry::SelectionFootprint>
{
......
Markdown is supported
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