source: GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/NPrim.h @ 774

Revision 774, 988 bytes checked in by gumbau, 19 years ago (diff)

GTGeometry and GeoTool? initial imports

Line 
1#ifndef NAUTILUS_NPRIM_INCLUDED // -*- C++ -*-
2#define NAUTILUS_NPRIM_INCLUDED
3
4/************************************************************************
5
6  Common code for modeling primitives.  These are the interfaces that
7  most modeling primitives are expected to inherit.
8  $Id: NPrim.h,v 1.2 1997/06/25 16:19:20 garland Exp $
9
10 ************************************************************************/
11
12class NPrim
13{
14public:
15    int uniqID;
16
17    inline bool isValid()     { return uniqID >= 0; }
18    inline void markInvalid() { if( uniqID>=0 ) uniqID = -uniqID-1; }
19    inline void markValid()   { if( uniqID<0  ) uniqID = -uniqID-1; }
20    inline int  validID()     { return (uniqID<0)?(-uniqID-1):uniqID; }
21};
22
23
24class NTaggedPrim : public NPrim
25{
26public:
27    int tempID;
28
29    inline void untag() { tempID = 0; }
30    inline void tag(int t=1) { tempID = t; }
31    inline bool isTagged() { return tempID!=0; }
32};
33
34
35// NAUTILUS_NPRIM_INCLUDED
36#endif
Note: See TracBrowser for help on using the repository browser.