Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

Segment.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2005 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 #ifndef _DWFTK_SEGMENT_H
00020 #define _DWFTK_SEGMENT_H
00021 
00022 
00027 
00028 #ifndef DWFTK_READ_ONLY
00029 
00030 
00031 #include "dwfcore/String.h"
00032 using namespace DWFCore;
00033 
00034 #include "dwf/Toolkit.h"
00035 #include "dwf/w3dtk/BStream.h"
00036 #include "dwf/w3dtk/BOpcodeHandler.h"
00037 #include "dwf/w3dtk/BOpcodeShell.h"
00038 #include "dwf/package/utility/PropertyContainer.h"
00039 #include "dwf/publisher/PublishedObject.h"
00040 #include "dwf/publisher/model/AttributeHandlerBuilder.h"
00041 #include "dwf/publisher/model/GeometryHandlerBuilder.h"
00042 #include "dwf/publisher/model/FeatureHandlerBuilder.h"
00043 #include "dwf/publisher/model/SegmentHandlerBuilder.h"
00044 
00045 
00046 
00047 namespace DWFToolkit
00048 {
00049 
00050 //
00051 // fwd decl
00052 //
00053 class DWFStyleSegment;
00054 class DWFIncludeSegment;
00055 
00056 
00064 class DWFSegment : public DWFToolkitMemory
00065                  , public DWFAttributeHandlerBuilder
00066                  , public DWFGeometryHandlerBuilder
00067                  , public DWFFeatureHandlerBuilder
00068                  , public DWFPropertyContainer
00069 {
00070 
00071 
00072 public:
00073 
00078     static const char* const kz_User_Options_Node;
00082     static const char* const kz_User_Options_Edges;
00088     static const char* const kz_User_Options_Node_and_Edges;
00089 
00093     typedef DWFPublishedObject::tKey   tKey;
00094 
00095 public:
00096 
00109     _DWFTK_API
00110     DWFSegment( DWFSegmentHandlerBuilder&     rSegmentBuilder,
00111                 DWFGeometryHandlerBuilder&    rGeometryBuilder,
00112                 DWFFeatureHandlerBuilder&     rFeatureBuilder,
00113                 DWFAttributeHandlerBuilder&   rAttributeBuilder,
00114                 DWFPublishedObject::Factory&  rObjectFactory,
00115                 DWFPublishedObject*           pPublishedParent = NULL )
00116         throw();
00117 
00124     _DWFTK_API
00125     DWFSegment( const DWFSegment& rSegment )
00126         throw( DWFException );
00127 
00134     _DWFTK_API
00135     DWFSegment& operator=( const DWFSegment& rSegment )
00136         throw( DWFException );
00137 
00143     _DWFTK_API
00144     virtual ~DWFSegment()
00145         throw();
00146 
00153     _DWFTK_API
00154     tKey key() const
00155         throw();
00156 
00175     _DWFTK_API
00176     virtual void open( const DWFString* pName = NULL,
00177                        bool             bPublishedEdges = false )
00178         throw( DWFException );
00179 
00198     _DWFTK_API
00199     virtual void open( const DWFString& zName,
00200                        bool             bPublishedEdges = false )
00201         throw( DWFException );
00202 
00212     _DWFTK_API
00213     void close()
00214         throw( DWFException );
00215 
00225     _DWFTK_API
00226     DWFSegment openSegment()
00227         throw( DWFException );
00228 
00238     _DWFTK_API
00239     void style( DWFStyleSegment& rSegment )
00240         throw( DWFException );
00241 
00255     _DWFTK_API
00256     virtual void include( DWFIncludeSegment& rSegment )
00257         throw( DWFException );
00258 
00275     _DWFTK_API
00276     void include( DWFIncludeSegment& rSegment,
00277                   const DWFString&   zInstanceName )
00278         throw( DWFException );
00279 
00293     _DWFTK_API
00294     virtual void include( tKey nSegmentKey )
00295         throw( DWFException );
00296 
00313     _DWFTK_API
00314     void include( tKey             nSegmentKey,
00315                   const DWFString& zInstanceName )
00316         throw( DWFException );
00317 
00318 public:
00319 
00323     _DWFTK_API
00324     virtual const DWFProperty* const findProperty( const DWFString& zName,
00325                                                    const DWFString& zCategory = L"" ) const
00326         throw();
00327 
00331     _DWFTK_API
00332     virtual DWFProperty::tMap::Iterator* getProperties( const DWFString& zCategory = L"" )
00333         throw();
00334 
00338     _DWFTK_API
00339     virtual void addProperty( DWFProperty* pProperty,
00340                               bool         bOwnProperty = true )
00341         throw( DWFException );
00342 
00349     _DWFTK_API
00350     virtual void addProperty( const DWFProperty& rProperty )
00351         throw( DWFException );
00352 
00356     _DWFTK_API
00357     virtual void addPropertyContainer( DWFPropertyContainer* pContainer )
00358         throw( DWFException );
00359     
00363     _DWFTK_API
00364     virtual void referencePropertyContainer( const DWFPropertyContainer& rContainer )
00365         throw( DWFException );
00366 
00370     _DWFTK_API
00371     virtual void removeOwnedPropertyContainers( DWFPropertyContainer::tList& rContainerList,
00372                                                 bool                         bMakeReferences = false )
00373         throw( DWFException );
00374 
00378     _DWFTK_API
00379     virtual void removeReferencedPropertyContainers( DWFPropertyContainer::tList& rContainerList )
00380         throw( DWFException );
00381 
00385     _DWFTK_API
00386     virtual void removeAllPropertyContainers( DWFPropertyContainer::tList& rContainerList )
00387         throw( DWFException );
00388 
00392     _DWFTK_API
00393     virtual void copyProperties( DWFPropertyContainer& rContainer,
00394                                  bool                  bRemoveOwnership = false,
00395                                  bool                  bMakeReferences = false)
00396         throw( DWFException );
00397 
00398 public:
00399 
00403     _DWFTK_API
00404     TK_Area_Light& getAreaLightHandler()
00405         throw( DWFException );
00406 
00410     _DWFTK_API
00411     TK_Circle& getCircleHandler()
00412         throw( DWFException );
00413 
00417     _DWFTK_API
00418     TK_Circle& getCircularArcHandler()
00419         throw( DWFException );
00420 
00424     _DWFTK_API
00425     TK_Circle& getCircularChordHandler()
00426         throw( DWFException );
00427 
00431     _DWFTK_API
00432     TK_Circle& getCircularWedgeHandler()
00433         throw( DWFException );
00434 
00438     _DWFTK_API
00439     TK_Cutting_Plane& getCuttingPlaneHandler()
00440         throw( DWFException );
00441 
00445     _DWFTK_API
00446     TK_Point& getDistantLightHandler()
00447         throw( DWFException );
00448 
00452     _DWFTK_API
00453     TK_Ellipse& getEllipseHandler()
00454         throw( DWFException );
00455 
00459     _DWFTK_API
00460     TK_Ellipse& getEllipticalArcHandler()
00461         throw( DWFException );
00462 
00466     _DWFTK_API
00467     TK_Image& getImageHandler()
00468         throw( DWFException );
00469 
00473     _DWFTK_API
00474     TK_Line& getLineHandler()
00475         throw( DWFException );
00476 
00480     _DWFTK_API
00481     TK_Point& getLocalLightHandler()
00482         throw( DWFException );
00483 
00487     _DWFTK_API
00488     TK_NURBS_Curve& getNURBSCurveHandler()
00489         throw( DWFException );
00490 
00494     _DWFTK_API
00495     TK_NURBS_Surface& getNURBSSurfaceHandler()
00496         throw( DWFException );
00497 
00501     _DWFTK_API
00502     TK_PolyCylinder& getPolyCylinderHandler()
00503         throw( DWFException );
00504 
00508     _DWFTK_API
00509     TK_Polypoint& getPolygonHandler()
00510         throw( DWFException );
00511 
00515     _DWFTK_API
00516     TK_Polypoint& getPolylineHandler()
00517         throw( DWFException );
00518 
00522     _DWFTK_API
00523     TK_Shell& getShellHandler( bool bTriStripsOnly = false,
00524                                bool bDisableOptimization = false )
00525         throw( DWFException );
00526 
00530     _DWFTK_API
00531     TK_Spot_Light& getSpotLightHandler()
00532         throw( DWFException );
00533 
00537     _DWFTK_API
00538     TK_Text& getTextHandler()
00539         throw( DWFException );
00540 
00544     _DWFTK_API
00545     TK_Text& getTextWithEncodingHandler()
00546         throw( DWFException );
00547 
00551     _DWFTK_API
00552     TK_Texture& getTextureHandler()
00553         throw( DWFException );
00554 
00558     _DWFTK_API
00559     TK_Matrix& getTextureMatrixHandler()
00560         throw( DWFException );
00561 
00565     _DWFTK_API
00566     TK_Color& getColorHandler()
00567         throw( DWFException );
00568 
00572     _DWFTK_API
00573     TK_Color_Map& getColorMapHandler()
00574         throw( DWFException );
00575 
00579     _DWFTK_API
00580     TK_Color_RGB& getColorRGBHandler()
00581         throw( DWFException );
00582 
00586     _DWFTK_API
00587     TK_Linear_Pattern& getEdgePatternHandler()
00588         throw( DWFException );
00589 
00593     _DWFTK_API
00594     TK_Size& getEdgeWeightHandler()
00595         throw( DWFException );
00596 
00600     _DWFTK_API
00601     TK_Enumerated& getFacePatternHandler()
00602         throw( DWFException );
00603 
00607     _DWFTK_API
00608     TK_Enumerated& getHandednessHandler()
00609         throw( DWFException );
00610 
00614     _DWFTK_API
00615     TK_Heuristics& getHeuristicsHandler()
00616         throw( DWFException );
00617 
00621     _DWFTK_API
00622     TK_Linear_Pattern& getLinePatternHandler()
00623         throw( DWFException );
00624 
00628     _DWFTK_API
00629     TK_Size& getLineWeightHandler()
00630         throw( DWFException );
00631 
00635     _DWFTK_API
00636     TK_Size& getMarkerSizeHandler()
00637         throw( DWFException );
00638 
00642     _DWFTK_API
00643     TK_Enumerated& getMarkerSymbolHandler()
00644         throw( DWFException );
00645 
00649     _DWFTK_API
00650     TK_Matrix& getModellingMatrixHandler()
00651         throw( DWFException );
00652 
00656     _DWFTK_API
00657     TK_Rendering_Options& getRenderingOptionsHandler()
00658         throw( DWFException );
00659 
00663     _DWFTK_API
00664     TK_Selectability& getSelectabilityHandler()
00665         throw( DWFException );
00666 
00670     _DWFTK_API
00671     TK_Enumerated& getTextAlignmentHandler()
00672         throw( DWFException );
00673 
00677     _DWFTK_API
00678     TK_Text_Font& getTextFontHandler()
00679         throw( DWFException );
00680 
00684     _DWFTK_API
00685     TK_Point& getTextPathHandler()
00686         throw( DWFException );
00687 
00691     _DWFTK_API
00692     TK_Size& getTextSpacingHandler()
00693         throw( DWFException );
00694 
00698     _DWFTK_API
00699     TK_User_Options& getUserOptionsHandler()
00700         throw( DWFException );
00701 
00705     _DWFTK_API
00706     TK_Unicode_Options& getUnicodeOptionsHandler()
00707         throw( DWFException );
00708 
00712     _DWFTK_API
00713     TK_Visibility& getVisibilityHandler()
00714         throw( DWFException );
00715 
00716 protected:
00717 
00718     DWFSegmentHandlerBuilder&       _rSegmentBuilder;
00719     DWFGeometryHandlerBuilder&      _rGeometryBuilder;
00720     DWFFeatureHandlerBuilder&       _rFeatureBuilder;
00721     DWFAttributeHandlerBuilder&     _rAttributeBuilder;
00722     DWFPublishedObject::Factory&    _rObjectFactory;
00723     
00724     DWFPublishedObject*             _pPublishedObject;
00725     DWFPublishedObject*             _pPublishedParent;
00726 
00727     DWFString*                      _pLibrary;
00728 
00729 private:
00730 
00731     bool                            _bOpen;
00732     DWFPublishedObject::tKey        _nKey;
00733     static DWFPublishedObject::tKey _knNextKey;
00734 
00735 private:
00736 
00737     //
00738     // Not Implemented
00739     //
00740 
00741     DWFSegment();
00742 };
00743 
00744 
00745 
00746     //
00747     // required for win32 dll external linkage
00748     //
00749 #ifdef  _DWFCORE_WIN32_SYSTEM
00750 #ifndef DWFTK_STATIC
00751 
00752 _declspec(selectany) const char* const DWFSegment::kz_User_Options_Node                         = "node";
00753 _declspec(selectany) const char* const DWFSegment::kz_User_Options_Edges                        = "edges";
00754 _declspec(selectany) const char* const DWFSegment::kz_User_Options_Node_and_Edges               = "node,edges";
00755 
00756 #endif
00757 #endif
00758 
00759 
00760 }
00761 
00762 
00763 #endif  
00764 #endif
00765 

Generated on Tue May 17 12:38:51 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1