I have the two functions:
Code: Select all
void BaseGeom::intersectionLL(TechDraw::BaseGeomPtr geom1, TechDraw::BaseGeomPtr geom2, std::vector<Base::Vector3d>& interPoints)
{
...
}
std::vector<Base::Vector3d> BaseGeom::intersection(TechDraw::BaseGeomPtr geom2)
{
...
std::vector<Base::Vector3d> interPoints;
intersectionLL(this, geom2, interPoints); // <-- compiler message
}
...
TechDraw::BaseGeomPtr geom1 = ...
TechDraw::BaseGeomPtr geom2 = ...
interPoints = geom1->intersection(geom2);
The compiler message occures, because "this" is of type TechDraw::BaseGeom*, it should be TechDraw::BaseGeomPtr.error: cannot convert ‘TechDraw::BaseGeom*’ to ‘TechDraw::BaseGeomPtr’ {aka ‘std::shared_ptr<TechDraw::BaseGeom>’}
How can I convert "this" ?