[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

CadDoc works!



CadDoc is a new subclass of Doc which I've just added to the
Docs&Links layer.  Instead of a TEXT_SPACE, it has a HANDLE_SPACE with
appropriate Waldos for their manipulation.  The coordinate space type
is "basicSpace (cat_PackageOfBits, UNIQUE)", i.e., an unordered
coordinate space whose positions are instances of PackageOfBits.  A
PackageOfBits should correspond to an AutoCad Handle as we've
discussed.

All the above was straightforwards, more work was involved in getting
a Waldo to handle ESpace well.  This has now been done.  To quote from
CadDoc-test.cxx: 

    doc1 = makeCadDoc (gk, bitArray("~lutz/demo/shuttle.autoCad"));
    doc2 = makeCadDoc (gk, bitArray("~lutz/demo/skyscraper.autoCad"));

I.e., when you create a CadDoc type document, you can give it an
arbitrary string which should tell you what external AutoCad document
this CadDoc corresponds to.  Then as handles are created in the
AutoCad document, you add them to your CadDoc as well:

    handles1 = doc1->handleSpace ();
    handles1->store (packageOfBits ("circle1"));
    handles1->store (packageOfBits ("square1"));

where "packageOfBits ('circle1')" is replaced by a PackageOfBits
containing the bit pattern of an AutoCad handle.  As handles are
removed from the AutoCad document, they should be removed from the
CadDoc also.

All the code for making and following links works as well for CadDoc's
as for TextualDoc's.  Link oriented backfollow isn't working very well
yet (it's got bugs), but all the problems, and virtually all the
mechanism, is shared among all Doc types.

Note that this isn't yet in Alpha, and my working version is descended
from padl-2, not from Alpha.  I'll be publishing it soon as padl-2.1.
Other than as an interface, I don't think this'll be too useful to you
until I re-integrate with Alpha.