I am trying to write a class for a custom curve object that also includes custom drawing. At this phase I am still testing around and trying to become familiar with writing plugins in c++. However, it appears that the override for the draw function suddenly stops working as soon as I modify the grips for the associated curve. Can anyone explain why and how to fix this? Here is the code:
#include "stdafx.h"
#include "planCurve.h"
#include "rhinoSdkDraw.h"
ON_OBJECT_IMPLEMENT(planCurve,CRhinoCurveObject, "A0590105-4EE2-4924-A1BC-88554592C6D4")
planCurve::planCurve()
{
this->EnableGrips(true);
}
void planCurve::Draw(CRhinoDisplayPipeline& dc) const
{
ON_Color color = ON_Color(100, 100, 200);
const ON_Curve* crv = this->Curve();
dc.DrawCurve(*crv, color, 5,NULL);
}
void planCurve::DrawHighlightedSubObjects(CRhinoDisplayPipeline& dc) const
{
}
planCurve::planCurve(const planCurve& src)
: CRhinoCurveObject(src)
{
}
planCurve& planCurve::operator=(const planCurve& src)
{
if (&src != this)
{
CRhinoCurveObject::operator=(src);
}
return *this;
}
ON_Curve* planCurve::SetCurve(const ON_NurbsCurve& curve)
{
return CRhinoCurveObject::SetCurve(curve);
}
void planCurve::SetCurve(ON_NurbsCurve* pCurve)
{
CRhinoCurveObject::SetCurve(pCurve);
}
planCurve::~planCurve()
{
}