ncntrcnt.h

Go to the documentation of this file.
00001 // $Id: ncntrcnt.h 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 #ifndef NCNTRCNT_H
00100 #define NCNTRCNT_H
00101 
00102 #include "blendatt.h"
00103 #include "pathpcs.h"
00104 //#include "cxfrech.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 //#include "biasgain.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 //#include "quality.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 #include "qualattr.h"
00108 //#include "group.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00109 //#include "control.h"
00110 
00111 class NodeContour;
00112 class CCAttrMap;
00113 class ExtendParams;
00114 class BlendNodeParam;
00115 
00116 /***********************************************************************************************
00117 
00118 >   class InsetPathPathProcessor : public PathProcessor
00119 
00120     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00121     Created:    31/3/2000
00122     Purpose:    Makes sure the original nodes aren't rendered, if the active flag is set
00123 
00124 ***********************************************************************************************/
00125 class InsetPathPathProcessor : public PathProcessor
00126 {
00127     CC_DECLARE_DYNAMIC(InsetPathPathProcessor);
00128 public:
00129     InsetPathPathProcessor();
00130     ~InsetPathPathProcessor();
00131 
00132     virtual void ProcessPath(Path *pPath,
00133                              RenderRegion *pRender,
00134                              PathShape ShapePath = PATHSHAPE_PATH);
00135 
00136     void SetActive(BOOL b) { m_bActive = b; }
00137 private:
00138     BOOL m_bActive;
00139 } ;
00140 
00141 
00142 
00143 /***********************************************************************************************
00144 
00145 >   class NodeContourController : public NodeGroup
00146 
00147     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00148     Created:    12/8/99
00149     Purpose:    Contour node controller class
00150 
00151 ***********************************************************************************************/
00152 
00153 class NodeContourController : public NodeGroup
00154 {
00155     // Give my name out in memory dumps
00156     CC_DECLARE_DYNCREATE(NodeContourController);
00157 
00158 public:
00159     NodeContourController();
00160 
00161     NodeContourController(Node* ContextNode,  
00162                 AttachNodeDirection Direction,  
00163                 BOOL Locked = FALSE, 
00164                 BOOL Mangled = FALSE,  
00165                 BOOL Marked = FALSE, 
00166                 BOOL Selected = FALSE    
00167                 ) ;
00168 
00169     ~NodeContourController();
00170 
00171     // Copy functions
00172     virtual Node* SimpleCopy(); 
00173     void CopyNodeContents(NodeContourController* pNewNode);
00174     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00175 
00176     // get the bounding rect of me
00177     virtual DocRect GetBoundingRect(BOOL DontUseAttrs = FALSE, BOOL HitTest = FALSE);
00178     virtual DocRect GetBlobBoundingRect();
00179 
00180     // Karim 14/04/2000 - helper method for marquee selection.
00181     virtual void SelectInRect(const DocRect& Rect, SelStateAction st);
00182 
00183     virtual void PreExportRender( RenderRegion* pRender ); 
00184     virtual BOOL ExportRender( RenderRegion* pRender ); 
00185     virtual void Render(RenderRegion* pRender);
00186 
00187     virtual void RenderTinyBlobs(RenderRegion* pRender);
00188     
00189     virtual BOOL DoBecomeA(BecomeA* pBecomeA);
00190     virtual BOOL CanBecomeA(BecomeA* pBecomeA);
00191 
00192     virtual NodeRenderableInk * CreateTreeFromNodeToBlend(NodeRenderableInk * pNode, 
00193         CCAttrMap * pAttrMap);
00194 
00195     // compound nodes overrides
00196     virtual BOOL RegenerateNode(UndoableOperation * pOp = NULL,
00197         BOOL bCacheRender = FALSE, BOOL bInformParents = TRUE);
00198 
00199     virtual ChangeCode OnChildChange(ObjChangeParam* pParam);
00200     
00201     // when the user clicks on a child node, this tells the hit testing code
00202     // whether to promote the hit test to this node
00203     virtual BOOL PromoteHitTestOnChildrenToMe() const { return FALSE; }
00204 
00205     // this indicates whether node should transform with its children
00206     virtual BOOL ShouldITransformWithChildren() const { return TRUE; }
00207 
00208     // retrieves this node's contour child
00209     NodeContour * GetContourNode();
00210 
00211     void SetNumberOfSteps(UINT32 Steps) { m_Steps = Steps; }
00212     void SetWidth(INT32 Width)        { m_Width = Width; }
00213 
00214     void SetColourBlendType(ColourBlendType Type) { m_BlendType = Type; }
00215     ColourBlendType GetColourBlendType()          { return m_BlendType; }
00216 
00217     UINT32 GetNumberOfSteps() { return m_Steps; }
00218     INT32 GetWidth()            { return m_Width; }
00219 
00220     virtual String Describe(BOOL Plural, BOOL Verbose); 
00221 
00222     void Transform(TransformBase &Trans);
00223 
00224     // Version 2 file format functions
00225     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00226     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00227 
00228     virtual BOOL PostImport();          // function called after import
00229 
00230     // are there any open paths in my child list
00231     BOOL AreOpenPathsInChildren();
00232 
00233     virtual BOOL AllowOp(ObjChangeParam *pParam, BOOL SetOpPermissionState = TRUE,
00234                                                  BOOL DoPreTriggerEdit = TRUE);
00235 
00236     virtual BOOL RegenerateForPrinting() { return FALSE; }
00237 
00238     virtual void RenderEorDrag( RenderRegion* pRender );
00239     virtual BOOL ChildrenAreEorDragRenderedByMe() { return TRUE; }
00240 
00241     INT32 ComplexHide(UndoableOperation* pOp, Node* pNextInRange);
00242 
00243     void SetObjectProfile( const CProfileBiasGain &Profile )    { m_ObjBiasGain = Profile; }
00244     void SetAttrProfile( const CProfileBiasGain &Profile )      { m_AttrBiasGain = Profile; } 
00245     CProfileBiasGain GetObjectProfile() { return m_ObjBiasGain; }
00246     CProfileBiasGain GetAttrProfile()   { return m_AttrBiasGain; }
00247     CProfileBiasGain* GetObjectProfilePtr() { return &m_ObjBiasGain; }
00248     CProfileBiasGain* GetAttrProfilePtr()   { return &m_AttrBiasGain; }
00249 
00250     virtual BOOL IsController() { return TRUE;}
00251     virtual BOOL IsAContourController() const { return TRUE;}
00252 
00253     virtual BOOL EndBlendStep(BlendNodeParam * pParam);
00254 
00255     BOOL IsContourAnOuterContour() { return (m_Width < 0); }
00256     // Karim MacDonald 25/11/1999
00257     // virtual Extend functions; see declaration/implementation in Node.
00258 
00259     BOOL GetInsetPathFlag() { return m_bInsetPath; }
00260     void SetInsetPathFlag(BOOL b) { m_bInsetPath = b; }
00261     
00262 public:
00263     virtual BOOL IsTypeExtendible() const { return TRUE; }
00264     virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00265     virtual void Extend(const ExtendParams& ExtParams);
00266 
00267 public:
00268     // the pre render children function for inset path stuff
00269     virtual SubtreeRenderState RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00270 
00271     // disables and enables the inset path path processor
00272     void DisableInsetPathPathProcessor();
00273     void EnableInsetPathPathProcessor();    
00274 
00275     virtual BOOL PromoteAttributeApplicationToMe(CCRuntimeClass *pAttrClass) const;
00276 
00277     NodeContour* GetContour ();
00278 
00279         // retrieves the node that we end up contouring
00280     virtual NodeRenderableInk* GetInkNodeFromController() const;
00281     virtual BOOL GroupCanTransformCached(TransformBase& Trans) const {return Trans.IsTranslation();} //{return FALSE;}
00282 
00283 protected:
00284     BOOL DealWithJoinTypeChange(UndoableOperation * pOp);
00285 
00286 
00287 private:
00288     BOOL BlendParameters (NodeContourController * pStart, NodeContourController * pEnd, double Scale);
00289     BOOL BlendParameters(NodeContourController * pStart, double Scale);
00290 
00291 protected:
00292     UINT32 m_Steps;
00293     INT32 m_Width;
00294     ColourBlendType m_BlendType;
00295 
00296     CProfileBiasGain m_AttrBiasGain;
00297     CProfileBiasGain m_ObjBiasGain;
00298 
00299     BOOL m_bInsetPath;
00300     BOOL m_PerformedExtend;
00301 
00302     InsetPathPathProcessor* m_pPathProc;
00303 } ;
00304 
00305 /***********************************************************************************************
00306 
00307 >   class ContourNodeTreeFactory : public CompoundNodeTreeFactory
00308 
00309     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00310     Created:    18/8/99
00311     Purpose:    Creates a new contour node with the given parameters
00312 
00313 ***********************************************************************************************/
00314 class ContourNodeTreeFactory : public CompoundNodeTreeFactory
00315 {
00316     CC_DECLARE_DYNCREATE(ContourNodeTreeFactory);
00317 
00318 public:
00319     ContourNodeTreeFactory();
00320     ~ContourNodeTreeFactory();
00321 
00322     NodeCompound * CreateNode(List * pList, UndoableOperation * pOp = NULL);
00323 
00324     void SetNumberOfSteps(UINT32 Steps) { m_Steps = Steps; }
00325     void SetWidth(UINT32 Width)       { m_Width = Width; }
00326     UINT32 GetNumberOfSteps()             { return m_Steps; }
00327     UINT32 GetWidth()                     { return m_Width; }
00328     void SetAttributeMap(CCAttrMap * pMap)            { m_pMap = pMap; }
00329     void SetInsetPathFlag(BOOL b)     { m_bInsetPath = b; }
00330 protected:
00331     UINT32 m_Steps;
00332     UINT32 m_Width;
00333     CCAttrMap * m_pMap;
00334     BOOL m_bInsetPath;
00335 } ;
00336 
00337 /***********************************************************************************************
00338 
00339 >   class ContourNodePathProcessor : public PathProcessor
00340 
00341     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00342     Created:    18/8/99
00343     Purpose:    The path processor which is used to sum all paths to be contoured
00344 
00345 ***********************************************************************************************/
00346 class ContourNodePathProcessor : public PathProcessor
00347 {
00348     CC_DECLARE_DYNCREATE(ContourNodePathProcessor);
00349 public:
00350     ContourNodePathProcessor();
00351     ~ContourNodePathProcessor();
00352 
00353     virtual void ProcessPath(Path * pPath,
00354                              RenderRegion * pRegion,
00355                              PathShape ShapePath = PATHSHAPE_PATH);
00356 
00357     void SetActive(BOOL bActive) { m_bActive = bActive; }
00358 
00359     void SetIsPrinting(BOOL bPrinting) { m_bPrinting = bPrinting; }
00360     
00361     // whether to test the line width to decide whether to extend the path or not
00362     // if false, processor ALWAYS extends the line width
00363     void TestLineWidth(BOOL bLineWidth) { m_bLineWidthTest = bLineWidth; }
00364 
00365     // calculates the maximum inner contour width possible with the given controller node
00366     static MILLIPOINT GetMaxInnerContourWidth(NodeCompound * pNode);
00367 
00368 private:
00369     BOOL m_bActive;
00370     BOOL m_bLineWidthTest;
00371     BOOL m_bPrinting;
00372     BOOL m_bRespectJoinType;
00373 } ;
00374 
00375 /***********************************************************************************************
00376 
00377 >   class ContourRecordHandler : public CamelotRecordHandler
00378 
00379     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00380     Created:    27/10/98
00381     Purpose:    Handles the reading of all contour records
00382     SeeAlso:    -
00383 
00384 ***********************************************************************************************/
00385 
00386 class ContourRecordHandler : public CamelotRecordHandler
00387 {
00388     // Give my name out in memory dumps
00389     CC_DECLARE_DYNCREATE(ContourRecordHandler)
00390 
00391 public:
00392     // functions that must be implemented.
00393     ContourRecordHandler();
00394     ~ContourRecordHandler();
00395     virtual UINT32* GetTagList();
00396     virtual BOOL    HandleRecord(CXaraFileRecord* pCXaraFileRecord);
00397 } ;
00398 
00399 
00400 #endif
00401 
00402 
00403 
00404     
00405 
00406 

Generated on Sat Nov 10 03:45:48 2007 for Camelot by  doxygen 1.4.4