4 #ifndef LWPP_MOD_COMMAND_H
5 #define LWPP_MOD_COMMAND_H
18 static EDError
doScan (
void*p,
const EDPointInfo* info)
21 return host->
Scan(info);
23 virtual EDError
Scan(
const EDPointInfo* info) {
return EDERR_NONE;}
29 static EDError
doScan (
void*p, LWPntID
id)
32 return host->
Scan(
id);
34 virtual EDError
Scan(LWPntID
id) {
return EDERR_NONE;}
40 static EDError
doScan (
void*p,
const EDEdgeInfo* info)
43 return host->
Scan(info);
45 virtual EDError
Scan(
const EDEdgeInfo* info) {
return EDERR_NONE;}
51 static EDError
doScan (
void*p, LWEdgeID
id)
54 return host->
Scan(
id);
56 virtual EDError
Scan(LWEdgeID
id) {
return EDERR_NONE;}
62 static EDError
doScan (
void*p,
const EDPolygonInfo* info)
65 return host->
Scan(info);
67 virtual EDError
Scan(
const EDPolygonInfo* info) {
return EDERR_NONE;}
73 static EDError
doScan (
void*p, LWPolID
id)
76 return host->
Scan(
id);
78 virtual EDError
Scan(LWPolID
id) {
return EDERR_NONE;}
133 void Done (EDError err,
int selm)
136 if(
me)
me->done(
me->state, err, selm);
142 if(
me)
return me->pointCount(
me->state, lyr, mode);
149 if(
me)
return me->polyCount(
me->state, lyr, mode);
184 if(
me)
return me->pointInfo (
me->state,
id);
191 if (
me)
return me->polyInfo (
me->state,
id);
200 return (
me->polyNormal(
me->state,
id, n) != 0);
208 if (
me)
return me->addPoint(
me->state, xyz);
212 LWPolID
AddFace(
const char *surf,
int numPnt,
const LWPntID *pnts)
215 if (
me)
return me->addFace(
me->state, surf, numPnt, pnts);
219 LWPolID
AddCurve(
const char *surf,
int numPnt,
const LWPntID *pnts,
int flags)
222 if (
me)
return me->addCurve(
me->state, surf, numPnt, pnts, flags);
226 EDError
AddQuad(LWPntID p1, LWPntID p2, LWPntID p3, LWPntID p4)
229 if (
me)
return me->addQuad(
me->state, p1, p2, p3, p4);
233 EDError
AddTri(LWPntID p1, LWPntID p2, LWPntID p3)
236 if (
me)
return me->addTri(
me->state, p1, p2, p3);
240 EDError
AddPatch(
int nr,
int nc,
int lr,
int lc, EDBoundCv *r0, EDBoundCv *r1, EDBoundCv *c0, EDBoundCv *c1)
243 if (
me)
return me->addPatch(
me->state, nr, nc, lr, lc, r0, r1, c0, c1);
250 if (
me)
return me->remPoint (
me->state,
id);
257 if (
me)
return me->remPoly (
me->state,
id);
261 EDError
Move (LWPntID
id,
const double *delta)
264 if (
me)
return me->pntMove (
me->state,
id, delta);
272 if (
me)
return me->polSurf (
me->state,
id, name);
280 if (
me)
return me->polPnts (
me->state,
id, n, p);
294 if (
me)
return me->polFlag (
me->state,
id, mask, value);
306 EDError
SetPolTag (LWPolID
id, LWID type,
const char *name = 0)
309 if (
me)
return me->polTag (
me->state,
id, type, name);
326 EDError
SetVMap (LWPntID
id, LWID vmap,
const char *c = 0,
int i = 0,
float *f = 0)
329 if (
me)
return me->pntVMap (
me->state,
id, vmap, c, i, f);
342 LWPolID
AddPoly (LWID type,
int numPnt,
const LWPntID *pnt, LWPolID tmpl = 0,
const char *surf = 0 )
345 if (
me)
return me->addPoly (
me->state, type, tmpl, surf, numPnt, pnt);
357 LWPntID
AddIPoint (
double *xyz,
int numPnt,
const LWPntID *ids,
const double *wt = 0)
360 if (
me)
return me->addIPnt (
me->state, xyz, numPnt, ids, wt);
363 LWPntID
AddIPoint (
int numPnt,
const LWPntID *ids,
const double *wt = 0)
393 if (
me)
return me->initUV (
me->state, uv);
405 void *
Select (
void *vmapID, LWID vmaptype,
const char *vmapname)
408 if (
me)
return me->pointVSet (
me->state, vmapID, vmaptype, vmapname);
411 void *
Select (LWID vmaptype,
const char *vmapname)
413 return Select(0, vmaptype, vmapname);
433 if (
me)
return (
me->pointVGet (
me->state, point, val) != 0);
444 if (
me)
return me->polyTag (
me->state, polygon, tagtype);
456 if (
me)
return me->pntSelect (
me->state, pnt, sel ? 1 : 0);
468 if (
me)
return me->polSelect (
me->state, pol, sel ? 1 : 0);
477 bool ReadVMap (LWPntID point, LWPolID pol,
float *val)
480 if (
me)
return (
me->pointVPGet (
me->state, point, pol, val) != 0);
491 if (
me)
return (
me->pointVEval (
me->state, point, pol, val) != 0);
499 EDError
AddDiscoVMap (LWPntID point, LWPolID pol, LWID type,
const char *name,
int dim,
float *val)
502 if (
me)
return me->pntVPMap (
me->state, point, pol, type, name, dim, val);
515 if (
me)
return me->edgeCount (
me->state, lyr, mode);
536 if (
me)
return me->edgeInfo (
me->state,
id);
548 if (
me)
return me->edgeSelect (
me->state, edge, sel ? 1 : 0);
555 if (
me)
return me->edgePolys (
me->state, edge, pols);
562 if (
me)
return me->edgePoint1 (
me->state, edge);
569 if (
me)
return me->edgePoint2 (
me->state, edge);
580 if (
me)
return me->edgeFromPoints (
me->state, p1, p2);
587 if (
me)
me->edgeFlip (
me->state, edge);
594 if (
me)
me->pointPos (
me->state, pnt, pos);
601 if (
me)
return me->pointEdges (
me->state, pnt, edges);
608 if (
me)
return me->polyType (
me->state, pol);
615 if (
me)
return me->polyPoints (
me->state, pol, pnts);
622 if (
me)
return me->pointFlags (
me->state, pnt);
629 if (
me)
return me->edgeFlags (
me->state, edg);
636 if (
me)
return me->polyFlags (
me->state, pol);
643 if (
me)
return me->pointData (
me->state, pnt);
650 if (
me)
return me->edgeData (
me->state, edg);
657 if (
me)
return me->polyData (
me->state, pol);
664 if (
me)
return me->pointLayer (
me->state, pnt);
671 if (
me)
return me->edgeLayer (
me->state, edg);
678 if (
me)
return me->polyLayer (
me->state, pol);
685 if (
me)
return me->setLayer (
me->state, lyr);
691 if (
me)
return me->advanceLayer (
me->state);
698 if (
me)
return me->pointNew (
me->state, pnt);
705 if (
me)
return me->edgeNew (
me->state, edg);
712 if (
me)
return me->polyNew (
me->state, pol);
734 MeshEditBegin* editBegin()
737 return mc->editBegin;
739 MeshEditBegin2* editBegin2()
742 return mc->editBegin2;
752 LWCommandCode
Lookup (
const char *cmdName)
755 return mc->lookup(mc->data, cmdName);
757 int Execute (LWCommandCode cmd,
int argc,
const DynaValue *argv, EltOpSelect op, DynaValue *result)
760 return mc->execute(mc->data, cmd, argc, argv, op, result);
765 return mc->evaluate(mc->data, command);
770 mc->undoGroupBegin();
778 void EditBegin (
int pntBuf,
int polBuf, EltOpSelect opsel)
784 void EditBegin (
int pntBuf,
int edgeBuf,
int polBuf, EltOpSelect opsel)
787 return SetMeshEditOp(mc->editBegin2(pntBuf, edgeBuf, polBuf, opsel));
800 template <
typename T>
809 static int Activate (
int version, GlobalFunc* global, LWInstance inst,
void* serverData)
811 LWModCommand *local =
static_cast<LWModCommand *
>(inst);
813 T plugin(version, local);
814 return plugin.Activate(serverData);
820 #endif // LWPP_MOD_COMMAND_H