ssgetRolloverFilter

ssgetRolloverFilter

Anonymous
Not applicable
568 Views
5 Replies
Message 1 of 6

ssgetRolloverFilter

Anonymous
Not applicable

Hi!

 

I have a custom entity where I want the subentities to behave more or less like objects of their own. Don't ask me why, I'm maintaining old code...

 

I have derived a class from AcEdSSGetFilter3 and overridden ssgetRolloverFilter. I can make it work, sort of, by using:

 

void CSubEntSelFilter::ssgetRolloverFilter(const AcDbFullSubentPath& subEntityPath, AcDbFullSubentPathArray& highlightPaths)
{
  if (subEntityPath == AcDbFullSubentPath())
    return;
  highlightPaths[0].subentId().setType(AcDb::kVertexSubentType);
  highlightPaths[0].subentId().setIndex(2);
}

With this, the subentity 2 will always be highlighted no matter what part of my custom entity the mouse rolls over.

 

Very well, but how do I find out which subentity the mouse is over at this moment? The only solution I see is to create an input point monitor and store the gsMarkers that are sent into the gsSelectionMark parameter.

 

Or am I missing some subentityselect function that is called _before_ ssgetRolloverFilter?

 

0 Likes
569 Views
5 Replies
Replies (5)
Message 2 of 6

owenwengerd
Advisor
Advisor

I've never used this function, but it's apparent from the documentation that subEntityPath should describe the subentity beneath the cursor. If it doesn't, then you probably haven't implemented subentity paths for your custom entity.

 


Very well, but how do I find out which subentity the mouse is over at this moment?




--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi!

 

Thanks for your answer, but your assumption does not seem to be correct. Or I am misunderstanding something...

 

I have the following debug print inside ssgetRolloverFilter:

 

acutPrintf(_T("\n[CSubEntSelFilter::ssgetRolloverFilter] subEntityPath %dm highlightPaths.length %d"), (int) subEntityPath.subentId().index(), highlightPaths.length());

for (int i=0; i < highlightPaths.length(); ++i)
acutPrintf(_T("\n[CSubEntSelFilter::ssgetRolloverFilter] highlightPaths[%d].subid %d"), i, (int) highlightPaths[i].subentId().index());

 

which always gives:

 

[CSubEntSelFilter::ssgetRolloverFilter] subEntityPath 0m highlightPaths.length 1
[CSubEntSelFilter::ssgetRolloverFilter] highlightPaths[0].subid 0

 

As far as I have been able to understand, subEntityPath.subentid().index() is supposed to be the same kind of index I set with mode->subEntityTraits().setSelectionMarker(myMarker) in subWorldDraw? And the input point monitor correctly gives me these indices in the gsSelectionMark parameter.

 

So my solution so far is the following:

 

In DocData.h:

  AcDbFullSubentPathArray m_SubentsUnderMouse;

then

Acad::ErrorStatus CInputPointMonitor::monitorInputPoint(...)
{
  DocVars.docData().m_SubentsUnderMouse.removeAll();
  const int nrOfEntities = apertureEntities.length();
  for (int entityIndex = 0; entityIndex < nrOfEntities; ++entityIndex)
    DocVars.docData().m_SubentsUnderMouse.append(AcDbFullSubentPath(apertureEntities[entityIndex], AcDb::kVertexSubentType, gsSelectionMark[entityIndex]));
  return AcEdInputPointMonitor::monitorInputPoint(...);
}

and finally:

void CSubEntSelFilter::ssgetRolloverFilter(const AcDbFullSubentPath& subEntityPath, AcDbFullSubentPathArray& highlightPaths)
{
  if (subEntityPath == AcDbFullSubentPath())
    return;
  highlightPaths = DocVars.docData().m_SubentsUnderMouse;
}

 which works fine. But it should be unneccessary for me to keep my own array of what is supposed to be rollover-highlighted or not. Why doesn't AutoCAD give me the subpath index in ssgetRolloverFilter?

 

0 Likes
Message 4 of 6

Anonymous
Not applicable

BTW, I have implemented subGetSubentPathsAtGsMarker and subGetGsMarkersAtSubentPath for my custom object class. The first is never called, the second is called _after_ ssgetRolloverFilter (supposedly to find out which gsMarker the paths I return from ssgetRolloverFilter correspond to.

 

The necessity of these functions also seem quite odd to me, since the natural implementation would be:

 

Acad::ErrorStatus AcArrow::subGetGsMarkersAtSubentPath(const AcDbFullSubentPath& subPath, AcArray<Adesk::GsMarker>& gsMarkers) const
{
gsMarkers.append((Adesk::GsMarker) subPath.subentId().index());
return Acad::eOk;
}

 

 

0 Likes
Message 5 of 6

augusto.goncalves
Alumni
Alumni

I believe the point monitor can be the solution, mostly because the point monitor is the one called right before ssgetRolloverFilter.

 

Do you believe that is an issue on your scenario?

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 6 of 6

philippe.leefsma
Alumni
Alumni

We used to provide more samples with the ObjectARX SDK, unfortunately those are not fully included any more with the latest versions.

 

Here I am attaching the "entity" samples from ObjectARX 2009. You will find some fully implemented examples illustrating how to work with subentities.

 

I quickly migrated the SubEntity sample, but I couldn't migrate the COM wrapper part of it, so I removed it. According to the description of the sample, it seems to be what you are looking for, you can find the non-migrated samples in the zip:

 

The SubEntity sample application demonstrates the APIs for sub-entity selection manipulation.
The sample demonstrates the following sub-entity selection manipulation features:

1) Supports sub-entity selection and extracting the sub-entity information from the selection sets
2) Provide right-click menu support on selected sub-entities
3) Sub-entity grips on selected sub-entities
4) Implements COM wrapper for the sub-entities



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes