Polygon handler class has no access to polygon flags like whether polygon is hidden or visible..
scanPolys() inside of polygon handler will return you also hidden polys and 3rd party developer can't check whether user see them or not.
I informed about it couple times since 2008 when I found it..
On the left, what is selected is mesh generated by custom polygon handler. On the right you can see some polygons are hidden and not visible in viewport..
scanPolys() should return ALL polygons, like now, but also have polFlags() which will return hidden flag bit,
so custom polygon programmer will decide whether ignore them or not.
typedef struct st_LWPolygonTypeAccess
{
void *priv;
void *(*pntVLookup) (LWPolygonTypeAccessID, LWID, LWCStringUTF8 vmap_name);
int (*pntVIDGet) (LWPolygonTypeAccessID, LWPntID, float *vector, void *vmapid);
void (*pntOtherPos) (LWPolygonTypeAccessID, LWPntID, LWFVector pos);
int (*scanPolys) (LWPolygonTypeAccessID, LWPolScanFunc *, void *);
LWID (*polType) (LWPolygonTypeAccessID, LWPolID);
int (*polSize) (LWPolygonTypeAccessID, LWPolID);
LWPntID (*polVertex) (LWPolygonTypeAccessID, LWPolID, int);
LWCStringUTF8 (*polTag) (LWPolygonTypeAccessID, LWPolID, LWID);
} LWPolygonTypeAccess;
Where is polFlags() function?
Where is pntFlags() function to check whether point is visible by user in viewport?
As a result it is impossible to check whether curve has flags:
#define EDDF_SELECT (1<<0)
#define EDDF_DELETE (1<<1)
#define EDPF_CCEND (1<<2)
#define EDPF_CCSTART (1<<3)
As a result it is impossible to check whether some polygon is selected or not..
Custom polygon handler should get these information to highlight polygon using different color.
LightWave internal version of Catmull-Rom curve has access to EDPF_CCSTART, EDPF_CCEND, because we can see it as dashed line.
In LWMeshInfoID there is polFlag() but custom polygon handler is not receiving LWMeshInfoID.
(I don't think so it has EDDF_SELECT, which is also needed)
In newly introduced LWMeshFuncs there is no pntFlags nor polFlags at all!
LWPolygonTypeAccess should have function to get either LWMeshID and LWMeshInfoID and layer index and object index in LWObjectFuncs..