TraceDlg Class Reference

Dialog for tracer. More...

#include <tracedlg.h>

Inheritance diagram for TraceDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 TraceDlg ()
 Constructs the trace dialog Dialog.
 ~TraceDlg ()
 Destructor, does nothing.
void Do (OpDescriptor *)
 Creates and shows a Render Demo dialog.
void DoWithParam (OpDescriptor *pOp, OpParam *pParam)
 Performs the BfxOp for the first time.
virtual MsgResult Message (Msg *Message)
 This is the message handler for the TraceDlg.

Static Public Member Functions

static BOOL Init ()
 Creates an OpDescriptor for a Trace Dialog.
static OpState GetState (String_256 *, OpDescriptor *)
 Returns the OpState of the dialogue operation.

Static Public Attributes

static const UINT32 IDD = _R(IDD_TRACEDLG)
static const CDlgMode Mode = MODELESS

Protected Member Functions

BOOL RenderBitmap (ReDrawInfoType *ExtraInfo, KernelBitmap *BitmapToUse)
 Fills a renderable control with a bitmap.
BOOL FindBitmap ()
 Set pOriginal to point at a bitmap.
BOOL LoadSettings (INT32 *pSettings)
 Sets up the sliders to a settings bank.
BOOL SaveSettings (INT32 *pSettings)
 Sets up the sliders to a settings bank.
BOOL ReadParams ()
 This is a temporary routine to put the values in the TraceCtl into the dialog.
BOOL WriteParams ()
 This is a temporary routine to put the values in the dialog into the TraceCtl.
BOOL SetStatus (BOOL Tracing=FALSE)
 Makes status line reflect current status.
BOOL DoTrace (BOOL SingleStep)
 Temporary tracing routine.
BOOL FixOriginalComboBox ()
 Makes the combo box reflect the bitmaps within the document.
BOOL ReadOriginalComboBox ()
 Chooses a different bitmap from the combo box.
BOOL CheckOriginalBitmap ()
 Ensures pOriginal points to a valid bitmap in this document.
BOOL DestinationChanged ()
 Invalidates area for destination bitmap, marks no destination as yet.
BOOL OriginalChanged ()
 Invalidates area for original bitmap, marks no destination as yet.
BOOL SetTraceMethod (TraceMethod Method)
 Sets the trace method.
TraceMethod GetTraceMethod ()
 Sets up the sliders to a settings bank.
void Remove24BitTempCopy ()

Protected Attributes

std::list< String_256m_p24BitCopyNames
KernelBitmappOriginal
KernelBitmappPrevOriginal
TraceControlpTraceControl

Static Protected Attributes

static INT32 DefaultMode = (INT32)TRACEMETHOD_TRUECOL
static INT32 DefaultSetting [NUM_TRACEMETHOD][NUM_TRACESETTING] = { {1, 50, 25, 50, 50, 80, 15}, {1, 50, 25, 50, 50, 50, 50}, {1, 50, 25, 65, 65, 50, 50}, {1, 50, 25, 25, 25, 50, 50} }
static INT32 FactorySetting [NUM_TRACEMETHOD][NUM_TRACESETTING] = { {1, 50, 25, 50, 50, 80, 15}, {1, 50, 25, 50, 50, 50, 50}, {1, 50, 25, 65, 65, 50, 50}, {1, 50, 25, 25, 25, 50, 50} }

Private Member Functions

 CC_DECLARE_DYNCREATE (TraceDlg)

Detailed Description

Dialog for tracer.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 191 of file tracedlg.h.


Constructor & Destructor Documentation

TraceDlg::TraceDlg  ) 
 

Constructs the trace dialog Dialog.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 244 of file tracedlg.cpp.

00244                    : DialogOp(TraceDlg::IDD, TraceDlg::Mode) 
00245 {
00246     // Set the 2 colours that we can toggle between
00247     pOriginal = NULL;
00248     pPrevOriginal=NULL;
00249     pTraceControl = new TraceControl; // NULL means tracer won't work...
00250 }       

TraceDlg::~TraceDlg  ) 
 

Destructor, does nothing.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 264 of file tracedlg.cpp.

00265 {
00266     pOriginal = NULL;
00267     
00268     if(!m_p24BitCopyNames.empty())
00269     {
00270         Remove24BitTempCopy();
00271     }
00272 
00273     if (pTraceControl)
00274     {
00275         pTraceControl->InitBitmap(pOriginal);
00276         delete pTraceControl;
00277         pTraceControl = NULL;
00278     }
00279 } 


Member Function Documentation

TraceDlg::CC_DECLARE_DYNCREATE TraceDlg   )  [private]
 

BOOL TraceDlg::CheckOriginalBitmap  )  [protected]
 

Ensures pOriginal points to a valid bitmap in this document.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
pOriginal set [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 362 of file tracedlg.cpp.

00363 {
00364     Document * pDoc = Document::GetSelected();
00365 
00366     // Get the bitmap list
00367     BitmapList* Bitmaps = NULL;
00368     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00369 
00370     if (Bitmaps == NULL)
00371     {
00372         pOriginal = NULL;
00373         return OriginalChanged();
00374     }
00375     
00376     KernelBitmap * pBmp = NULL;
00377 
00378     pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00379 
00380     while (pBmp != NULL)
00381     {
00382         if (pBmp == pOriginal) return OriginalChanged(); // OK we've found it.
00383         pBmp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00384     }
00385 
00386     pOriginal = (KernelBitmap *)(Bitmaps->GetHead()); // possibly NULL but certainly on the list
00387     return OriginalChanged();
00388 }

BOOL TraceDlg::DestinationChanged  )  [protected]
 

Invalidates area for destination bitmap, marks no destination as yet.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 227 of file tracedlg.cpp.

00228 {
00229     InvalidateGadget(_R(IDC_TRACER_DESTREDRAW));
00230     return TRUE;
00231 }

void TraceDlg::Do OpDescriptor  )  [virtual]
 

Creates and shows a Render Demo dialog.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Reimplemented from Operation.

Definition at line 1414 of file tracedlg.cpp.

01415 {
01416     // if we can create the dialog, then open it
01417     if (Create())
01418         Open();
01419     else
01420         TRACE( _T("Failed to create Render Demo Dialog\n"));
01421 }

BOOL TraceDlg::DoTrace BOOL  SingleStep  )  [protected]
 

Temporary tracing routine.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/1/95

Definition at line 908 of file tracedlg.cpp.

00909 {
00910     if (pTraceControl && pOriginal)
00911     {
00912         WriteParams();
00913         KernelBitmap * pDestination;
00914         KernelBitmap * pTemp;
00915         pTraceControl->GetBitmaps(NULL, &pDestination, &pTemp);
00916         if ((!SingleStep) || (!pDestination) || (!pTemp))
00917             pTraceControl->InitBitmap(pOriginal);
00918 
00919         MonotonicTime MT;
00920 
00921         BOOL Done = FALSE;
00922         BOOL Abort = FALSE;
00923 
00924         String_64 ProcessMessage(_R(IDS_TRACEDLG_PREPROCESSING));
00925         BeginSlowJob(100, FALSE, &ProcessMessage);
00926         ContinueSlowJob();
00927 
00928         while ((!Done) && (!Abort))
00929         {
00930             Abort = !(pTraceControl->Trace(&Done));
00931             // invalidate the gadget with the picture in it
00932 
00933             if (!Abort)
00934             {
00935                 if ((Abort = (KeyPress::IsEscapePressed() ==TRUE) /*Assignment*/))
00936                 {
00937                     ERROR1RAW(_R(IDE_TRACER_ABORT));
00938                 }
00939             }
00940 
00941             if (Done || Abort || SingleStep || MT.Elapsed(1000, TRUE))
00942             {
00943                 InvalidateGadget(_R(IDC_TRACER_DESTREDRAW));
00944                 PaintGadgetNow(_R(IDC_TRACER_DESTREDRAW));
00945 
00946                 INT32 Percent;
00947                 INT32 NumPaths;
00948                 INT32 NumCusps;
00949                 INT32 NumPoints;
00950 
00951                 if ((pTraceControl->GetProgress(&Percent, &NumPaths, &NumCusps, &NumPoints))&& !Abort)
00952                 {
00953                     Abort = !ContinueSlowJob(Percent);
00954                     if (Abort) ERROR1RAW(_R(IDE_TRACER_ABORT));
00955                 }
00956                 SetStatus(TRUE);
00957                 //if (Done) TRACEUSER( "Alex", _T("**Done - %d Paths, %d Cusps, %d Points\n"), NumPaths, NumCusps, NumPoints);
00958 
00959             }
00960 
00961             if (SingleStep)
00962             {
00963                 EndSlowJob();
00964                 SetStatus();
00965                 return !Abort;
00966             }
00967 
00968         }
00969         EndSlowJob();
00970         SetStatus();
00971         return (!Abort);
00972     }
00973     return SetStatus();
00974 }

void TraceDlg::DoWithParam OpDescriptor pOp,
OpParam pParam
[virtual]
 

Performs the BfxOp for the first time.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/2/95
Parameters:
OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
The first parameter should be a kernel bitmap to use or null to just bring the dialog up

Reimplemented from Operation.

Definition at line 1440 of file tracedlg.cpp.

01441 {
01442     Do(pOp);
01443     KernelBitmap * pBitmap = NULL;
01444     if (pParam) pBitmap = (KernelBitmap *)(void *)(pParam->Param1);
01445     if (pBitmap && pBitmap->IsKindOf(CC_RUNTIME_CLASS(KernelBitmap)))
01446     {
01447         pOriginal=pBitmap;
01448         OriginalChanged();
01449     }
01450     return;
01451 }

BOOL TraceDlg::FindBitmap  )  [protected]
 

Set pOriginal to point at a bitmap.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
pOriginal set [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
One ought to call CheckOriginal after this call

Definition at line 854 of file tracedlg.cpp.

00855 {
00856 //  pOriginal = NULL;
00857 
00858     Range Sel(*(GetApplication()->FindSelection()));
00859 
00860     Node* FirstSelectedNode = Sel.FindFirst(); 
00861     if (FirstSelectedNode != NULL) // No nodes selected so End
00862     {
00863         Node* CurrentNode = FirstSelectedNode;       
00864         Node* NextCurrent; 
00865         
00866         // Do all bitmaps. OK this should pick up the fill as well. Never mind
00867         while (CurrentNode != NULL)
00868         {
00869             NextCurrent = Sel.FindNext(CurrentNode);
00870             if  ( (CurrentNode->IsSelected()) && (CurrentNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeBitmap)) ) 
00871             {         
00872                 pOriginal = ((NodeBitmap *)(CurrentNode))->GetBitmap();
00873                 return CheckOriginalBitmap();
00874             }
00875             CurrentNode = NextCurrent; 
00876         }
00877 
00878     } 
00879 
00880     // Find the first Fill Attribute in the selection
00881     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr();
00882 
00883     while (pAttrNode != NULL)
00884     {
00885         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapColourFill)))
00886         {
00887             pOriginal = pAttrNode->GetBitmap();
00888             return CheckOriginalBitmap();
00889         }
00890 
00891         // Check the next fill
00892         pAttrNode = AttrFillGeometry::FindNextSelectedAttr();
00893     }
00894 
00895     return CheckOriginalBitmap();
00896 }

BOOL TraceDlg::FixOriginalComboBox  )  [protected]
 

Makes the combo box reflect the bitmaps within the document.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
This routine is heavilly copied from one within the fill tool

Definition at line 407 of file tracedlg.cpp.

00408 {
00409     // Find the doccomponent with the list of bitmaps in it
00410     Document * pDoc = Document::GetSelected();
00411 
00412     // Get the bitmap list
00413     BitmapList* Bitmaps = NULL;
00414     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00415 
00416     if (Bitmaps == NULL)
00417         return TRUE;
00418 
00419     String_256 Str;
00420 
00421     DeleteAllValues(_R(IDC_TRACER_BITMAP));
00422 
00423     BOOL DoneMain = FALSE;
00424     INT32 SelIndex = 0;
00425 
00426     BOOL IsMono = FALSE;
00427     if ((pOriginal) && (pOriginal->GetBPP()==1)) IsMono=TRUE;
00428 
00429     EnableGadget(_R(IDC_TRACER_BLURNUM), !IsMono);
00430     EnableGadget(_R(IDC_TRACER_BLURSLIDER), !IsMono);
00431     EnableGadget(_R(IDC_TRACER_BLURTXT), !IsMono);
00432 
00433     if (Bitmaps->GetCount() > 0)
00434     {
00435         INT32 Index = 0;
00436 
00437         ListItem* pBmp = Bitmaps->GetHead();
00438 
00439         while (pBmp != NULL)
00440         {
00441             Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
00442             if (((KernelBitmap*)(pBmp)) == pOriginal)
00443             {
00444                 SetStringGadgetValue(_R(IDC_TRACER_BITMAP),Str, FALSE, -1);
00445                 DoneMain = TRUE;
00446                 SelIndex=Index;
00447             }
00448             SetStringGadgetValue(_R(IDC_TRACER_BITMAP),Str,FALSE, Index++);
00449             pBmp = Bitmaps->GetNext(pBmp);
00450         }
00451     }
00452     else
00453     {
00454         Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00455         SetStringGadgetValue(_R(IDC_TRACER_BITMAP),Str,TRUE, 0);
00456     }
00457 
00458     Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00459     SetComboListLength(_R(IDC_TRACER_BITMAP));
00460     if (!DoneMain)
00461     {
00462         SetStringGadgetValue(_R(IDC_TRACER_BITMAP),Str, FALSE, -1);
00463         SetSelectedValueIndex(_R(IDC_TRACER_BITMAP), 0);
00464     }
00465     else
00466     {
00467         SetSelectedValueIndex(_R(IDC_TRACER_BITMAP), SelIndex);
00468     }
00469     return TRUE;
00470 }

OpState TraceDlg::GetState String_256 ,
OpDescriptor
[static]
 

Returns the OpState of the dialogue operation.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 1351 of file tracedlg.cpp.

01352 {
01353     return OpState(FALSE, FALSE);
01354 }

TraceMethod TraceDlg::GetTraceMethod  )  [protected]
 

Sets up the sliders to a settings bank.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
Currently selected trace method

Errors: None at present

See also:
-

Definition at line 634 of file tracedlg.cpp.

00635 {
00636     TraceMethod Method;
00637     switch (GetSelectedValueIndex(_R(IDC_TRACER_METHOD)))
00638     {
00639         case 0:
00640             Method=TRACEMETHOD_MONO;
00641             break;
00642         case 1:
00643             Method=TRACEMETHOD_GREYSCALE;
00644             break;
00645         case 2:
00646             Method=TRACEMETHOD_256COL;
00647             break;
00648         case 3:
00649         default:
00650             Method=TRACEMETHOD_TRUECOL;
00651             break;
00652     }
00653     return Method;
00654 }

BOOL TraceDlg::Init void   )  [static]
 

Creates an OpDescriptor for a Trace Dialog.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Returns:
FALSE if it fails (due to lack of memory)

Reimplemented from SimpleCCObject.

Definition at line 1368 of file tracedlg.cpp.

01369 {  
01370     INT32 Mode;
01371     INT32 Setting;
01372     GetApplication()->DeclareSection( _T("Tracer"), 40);
01373     GetApplication()->DeclarePref( _T("Tracer"), _T("DefaultMode"), &DefaultMode, 0, ((INT32)TRACEMETHOD_ILLEGAL)-1);
01374     String_256 PrefName;
01375     String_256 PrefBase(_T("Tracer mode #1%d setting #2%d")); // not resourced as .ini file setting
01376     
01377     for (Mode=0; Mode<(INT32)NUM_TRACEMETHOD; Mode++) for (Setting=0; Setting<(INT32)NUM_TRACESETTING; Setting++)
01378     {
01379         PrefName._MakeMsg(PrefBase, Mode, Setting);
01380         GetApplication()->DeclarePref( _T("Tracer"), PrefName, &(DefaultSetting[Mode][Setting]), 0, 100);
01381     }
01382 
01383     return (RegisterOpDescriptor(0,                             // Tool ID
01384                                 _R(IDS_TRACEDLG),                   // String resouirce ID
01385                                 CC_RUNTIME_CLASS(TraceDlg),     // Runtime class
01386                                 OPTOKEN_TRACEDLG,               // Token string
01387                                 TraceDlg::GetState,             // GetState function
01388                                 0,                              // Help ID
01389                                 _R(IDBBL_BITMAPTRACER),             // Bubble ID
01390                                 _R(IDD_BARCONTROLSTORE),            // Resource ID
01391                                 _R(IDC_BITMAPTRACER),               // Control ID
01392                                 SYSTEMBAR_UTILITIES,            // Bar ID
01393                                 TRUE,                           // Recieve system messages
01394                                 FALSE,                          // Smart duplicate operation
01395                                 TRUE,                           // Clean operation
01396                                 0,                              // No vertical counterpart
01397                                 _R(IDS_TRACER_ONE),
01398                                 GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE)    // String for one copy only
01399         && TraceOp::Init()); // HORRIBLE! But means I don't have to get a lock on main.cpp
01400 }   

BOOL TraceDlg::LoadSettings INT32 *  pSettings  )  [protected]
 

Sets up the sliders to a settings bank.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
*pSettings points to area to load from [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 581 of file tracedlg.cpp.

00582 {
00583     SetLongGadgetValue(_R(IDC_TRACER_PASSESNUM),        pSettings[0]);
00584     SetLongGadgetValue(_R(IDC_TRACER_BLURSLIDER),       pSettings[1]); 
00585     SetLongGadgetValue(_R(IDC_TRACER_MINAREASLIDER),    pSettings[2]); 
00586     SetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER),        pSettings[3]); 
00587     SetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER),        pSettings[4]); 
00588     SetLongGadgetValue(_R(IDC_TRACER_ACCURACYSLIDER),   pSettings[5]); 
00589     SetLongGadgetValue(_R(IDC_TRACER_SMOOTHSLIDER),     pSettings[6]); 
00590     return ReadParams();
00591 }

MsgResult TraceDlg::Message Msg Message  )  [virtual]
 

This is the message handler for the TraceDlg.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Message,: The message [INPUTS]
Returns:
OK Message handled ok (return this even if you don't need to respond to the message).
FAIL Something terrible happened whilst processing the message eg. we ran out of memory. You must set ERROR if you are returning this value.

EAT_MSG The Message was handled ok but don't send it to any more MessageHandlers.

Reimplemented from DialogOp.

Definition at line 1090 of file tracedlg.cpp.

01091 {
01092     static INT32 OurMessage = 0;
01093     if (IS_OUR_DIALOG_MSG(Message))
01094     {
01095         DialogMsg* Msg = ((DialogMsg*) Message); 
01096         
01097         BOOL EndDialog = FALSE;     // TRUE if we should quit the dialog
01098         BOOL CommitValues = FALSE;  // TRUE if we should commit the dialog values
01099 
01100         switch (Msg->DlgMsg)
01101         {
01102             case DIM_CREATE:
01103             {
01104 
01105                 SetGadgetRange    (_R(IDC_TRACER_BLURSLIDER), 0, 100, 1);
01106                 SetGadgetBitmaps  (_R(IDC_TRACER_BLURSLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01107 //              SetLongGadgetValue(_R(IDC_TRACER_BLURSLIDER), 50); 
01108 
01109                 SetGadgetRange    (_R(IDC_TRACER_ACCURACYSLIDER), 0, 100, 1);
01110                 SetGadgetBitmaps  (_R(IDC_TRACER_ACCURACYSLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01111 //              SetLongGadgetValue(_R(IDC_TRACER_ACCURACYSLIDER), 50); 
01112 
01113                 SetGadgetRange    (_R(IDC_TRACER_MINAREASLIDER), 0, 50, 1);
01114                 SetGadgetBitmaps  (_R(IDC_TRACER_MINAREASLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01115 //              SetLongGadgetValue(_R(IDC_TRACER_MINAREASLIDER), 25); 
01116 
01117                 SetGadgetRange    (_R(IDC_TRACER_ICTSLIDER), 0, 100, 1);
01118                 SetGadgetBitmaps  (_R(IDC_TRACER_ICTSLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01119 //              SetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER), 35); 
01120 
01121                 SetGadgetRange    (_R(IDC_TRACER_FCTSLIDER), 0, 100, 1);
01122                 SetGadgetBitmaps  (_R(IDC_TRACER_FCTSLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01123 //              SetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER), 25); 
01124 
01125                 SetGadgetRange    (_R(IDC_TRACER_SMOOTHSLIDER), 0, 100, 1);
01126                 SetGadgetBitmaps  (_R(IDC_TRACER_SMOOTHSLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01127 //              SetLongGadgetValue(_R(IDC_TRACER_SMOOTHSLIDER), 50); 
01128 
01129 //              SetLongGadgetValue(_R(IDC_TRACER_PASSESNUM), 1);
01130 
01131                 pOriginal=NULL;
01132                 pPrevOriginal=NULL;
01133                 OurMessage=0;
01134                 FindBitmap();
01135 
01136                 DeleteAllValues(_R(IDC_TRACER_METHOD));
01137 
01138                 String_256 Str0(_R(IDS_TRACER_MONOCHROME));
01139                 String_256 Str1(_R(IDS_TRACER_GREYSCALE));
01140                 String_256 Str2(_R(IDS_TRACER_256COL));
01141                 String_256 Str3(_R(IDS_TRACER_TRUECOL));
01142             
01143                 SetStringGadgetValue(_R(IDC_TRACER_METHOD),Str0,FALSE, 0);
01144                 SetStringGadgetValue(_R(IDC_TRACER_METHOD),Str1,FALSE, 1);
01145                 SetStringGadgetValue(_R(IDC_TRACER_METHOD),Str2,FALSE, 2);
01146                 SetStringGadgetValue(_R(IDC_TRACER_METHOD),Str3,FALSE, 3);
01147             
01148 //              SetStringGadgetValue(_R(IDC_TRACER_METHOD),&Str3, FALSE, -1);
01149                 SetComboListLength(_R(IDC_TRACER_METHOD));
01150                 SetTraceMethod((TraceMethod)DefaultMode);
01151                 DefaultSetting[TRACEMETHOD_MONO][0]=1; // ensure this one pass
01152                 DefaultSetting[TRACEMETHOD_256COL][0]=1; // ensure this one pass
01153                 DefaultSetting[TRACEMETHOD_GREYSCALE][0]=1; // ensure this one pass
01154                 LoadSettings(DefaultSetting[(INT32)DefaultMode]);
01155 
01156 //              ReadParams();
01157                 WriteParams();
01158 //              SetStatus();
01159 //              FixOriginalComboBox();
01160                 break;
01161             }
01162             
01163             case DIM_SLIDER_POS_CHANGING:
01164             case DIM_SLIDER_POS_IDLE:
01165             case DIM_SLIDER_POS_SET:    
01166                 {
01167                     INT32 Passes = GetLongGadgetValue  (_R(IDC_TRACER_PASSESNUM),   0, 100, 0, NULL);
01168                     if (GetTraceMethod() != TRACEMETHOD_TRUECOL) Passes=1;
01169                     
01170                     if (!OurMessage && (Msg->GadgetID == _R(IDC_TRACER_ICTSLIDER) || Msg->GadgetID == _R(IDC_TRACER_FCTSLIDER)))
01171                     {
01172                         // We must fix sliders
01173                         INT32 CurrentInit = GetLongGadgetValue  (_R(IDC_TRACER_ICTSLIDER),  0, 100, 0, NULL);
01174                         INT32 CurrentFinal = GetLongGadgetValue  (_R(IDC_TRACER_FCTSLIDER), 0, 100, 0, NULL);
01175 
01176                         OurMessage++;
01177 
01178                         if (Msg->GadgetID == _R(IDC_TRACER_FCTSLIDER))
01179                         {
01180                             if (Passes<=1)
01181                             {
01182                                 SetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER), CurrentFinal);
01183                             }
01184                             else if (CurrentInit<=CurrentFinal)
01185                             {
01186                                 SetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER), ((CurrentFinal>=100)?100:CurrentFinal+1));
01187                             }
01188                         }
01189                         else
01190                         {
01191                             if (Passes<=1)
01192                             {
01193                                 SetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER), CurrentInit);
01194                             }
01195                             else if (CurrentInit<=CurrentFinal)
01196                             {
01197                                 SetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER), ((CurrentInit<=0)?0:CurrentInit-1));
01198                             }
01199                         }
01200 
01201                         OurMessage--;
01202                     }
01203                     ReadParams();
01204                 }
01205                 break;
01206 
01207             case DIM_TEXT_CHANGED:  // Text changed 
01208                 if (Msg->GadgetID == _R(IDC_TRACER_PASSESNUM)) ReadParams();
01209                 break;
01210 
01211             case DIM_COMMIT:        // Want to commit and quit
01212                 EndDialog = TRUE;
01213                 CommitValues = TRUE; 
01214                 break;
01215 
01216             case DIM_SOFT_COMMIT:   // Want to commit
01217                 CommitValues = TRUE; 
01218                 break; 
01219 
01220             case DIM_CANCEL:        // Want to quit
01221                 EndDialog = TRUE;
01222                 break;
01223 
01224             case DIM_LFT_BN_CLICKED :
01225             {
01226                 TraceMethod Method = GetTraceMethod();
01227                 // See which button was pressed
01228                 if (Msg->GadgetID == _R(IDC_TRACER_TRACEBTN))
01229                 {
01230                     if (!DoTrace(FALSE)) InformError();
01231                 }
01232                 else if (Msg->GadgetID == _R(IDC_TRACER_RESET))
01233                 {
01234                     LoadSettings(DefaultSetting[(INT32)Method]);
01235                 }
01236                 else if (Msg->GadgetID == _R(IDC_TRACER_SAVE))
01237                 {
01238                     DefaultMode=Method;
01239                     SaveSettings(DefaultSetting[(INT32)Method]);
01240                 }
01241                 else if (Msg->GadgetID == _R(IDC_TRACER_DEFAULT))
01242                 {
01243                     LoadSettings(FactorySetting[(INT32)Method]);
01244                 }
01245                 break;
01246             }
01247 
01248             case DIM_REDRAW :
01249             {
01250                 // This is where all the redrawing is done
01251                 // Which control in the window is sending the redraw message (if there are many
01252                 // grdraw controls you can tell which is which from the Gadget ID
01253                 KernelBitmap * pDestination;
01254                 KernelBitmap * pTemp;
01255                 pTraceControl->GetBitmaps(NULL, &pDestination, &pTemp);
01256 
01257                 // Draw the redraw_me control in here
01258                 if (Msg->GadgetID == _R(IDC_TRACER_ORIGREDRAW))
01259                 {
01260                     RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pOriginal);
01261                 }
01262                 else if (Msg->GadgetID == _R(IDC_TRACER_DESTREDRAW))
01263                 {
01264                     RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pDestination);
01265                 }
01266                 break;
01267             }
01268             
01269             case DIM_SELECTION_CHANGED:
01270             {
01271                 if (Msg->GadgetID == _R(IDC_TRACER_BITMAP))
01272                 {
01273                     ReadOriginalComboBox();
01274                 }
01275                 else if (Msg->GadgetID == _R(IDC_TRACER_METHOD))
01276                 {
01277                     LoadSettings(DefaultSetting[(INT32)GetTraceMethod()]);
01278                 }
01279                 break;                                                 
01280             }
01281 
01282             default:
01283                 break;
01284         }
01285 
01286         // End dialog here
01287         if (EndDialog)  // Dialog communication over 
01288         {   
01289             if (pTraceControl)
01290             {
01291                 BOOL Done;
01292                 pTraceControl->GetProgress(NULL,NULL,NULL,NULL,&Done);
01293                 if (CommitValues && pOriginal && Done)
01294                 {
01295                     TraceOpParam param;
01296                     param.pTraceControl = pTraceControl;
01297         
01298                     OpDescriptor* pOpDesc=OpDescriptor::FindOpDescriptor(_T("TraceOp"));
01299                     ERROR3IF_PF(pOpDesc==NULL,("Couldn't find OPTOKEN_OPTRACEOP op descriptor"));
01300                     pOpDesc->Invoke((OpParam*)&param);
01301                 }
01302 
01303                 pTraceControl->InitBitmap(NULL);
01304                 pOriginal = NULL;
01305                 pTraceControl->RemoveTree(TRUE /* delete it*/);
01306             }
01307 
01308             Close();           
01309             TRACEUSER( "Alex", _T("Calling End()\n"));
01310             End();      // End of dialog 
01311 
01312             return OK;
01313         }
01314         //return (DLG_EAT_IF_HUNGRY(Msg));   // I return EAT_MSG unless the message needs to be sent to all dialogs 
01315     } else if (MESSAGE_IS_A(Message, SelChangingMsg))       // Selection changed - use new bitmap
01316     {
01317         SelChangingMsg *Msg = (SelChangingMsg *) Message;
01318         switch ( Msg->State )
01319         {
01320             case SelChangingMsg::SELECTIONCHANGED:
01321             case SelChangingMsg::NODECHANGED:
01322 //              pOriginal=NULL;
01323                 FindBitmap();
01324                 break;
01325             default:
01326                 break;
01327         }
01328     } else if (MESSAGE_IS_A(Message, BitmapListChangedMsg))     // Selection changed - use new bitmap
01329     {
01330         CheckOriginalBitmap();
01331         FixOriginalComboBox();
01332     } else if (MESSAGE_IS_A(Message, TraceMsg))
01333     {
01334         pOriginal=((TraceMsg*)(Message))->pBitmap;
01335         CheckOriginalBitmap();
01336     }
01337 
01338     return DialogOp::Message(Message);
01339 } 

BOOL TraceDlg::OriginalChanged  )  [protected]
 

Invalidates area for original bitmap, marks no destination as yet.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 203 of file tracedlg.cpp.

00204 {
00205     if (pPrevOriginal==pOriginal) return TRUE;
00206     pPrevOriginal=pOriginal;
00207     if (pTraceControl) pTraceControl->InitBitmap(pOriginal);
00208     InvalidateGadget(_R(IDC_TRACER_ORIGREDRAW));
00209     return FixOriginalComboBox() && SetStatus() && DestinationChanged();
00210 }

BOOL TraceDlg::ReadOriginalComboBox  )  [protected]
 

Chooses a different bitmap from the combo box.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
This routine is heavilly copied from one within the fill tool

Definition at line 490 of file tracedlg.cpp.

00491 {
00492     Document * pDoc = Document::GetSelected();
00493     
00494     // Get the bitmap list
00495     BitmapList* Bitmaps = NULL;
00496     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00497 
00498     if (Bitmaps == NULL)
00499         return TRUE;
00500 
00501     ListItem* pBmp = Bitmaps->GetHead();
00502 
00503     WORD Index;
00504     GetValueIndex(_R(IDC_TRACER_BITMAP),&Index); 
00505 
00506     for (INT32 i = 0; i < Index; i++)
00507     {
00508         if (pBmp == NULL)
00509             break;
00510 
00511         pBmp = Bitmaps->GetNext(pBmp);
00512     }
00513 
00514     pOriginal = (KernelBitmap*)pBmp; // Might be NULL (conceivably)
00515     return CheckOriginalBitmap();
00516 }

BOOL TraceDlg::ReadParams  )  [protected]
 

This is a temporary routine to put the values in the TraceCtl into the dialog.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 703 of file tracedlg.cpp.

00704 {
00705     SetLongGadgetValue(_R(IDC_TRACER_BLURNUM),    GetLongGadgetValue(_R(IDC_TRACER_BLURSLIDER), 0, 100, 0, NULL));
00706     SetLongGadgetValue(_R(IDC_TRACER_MINAREANUM), GetLongGadgetValue(_R(IDC_TRACER_MINAREASLIDER), 0, 100, 0, NULL));
00707     SetLongGadgetValue(_R(IDC_TRACER_ACCURACYNUM),GetLongGadgetValue(_R(IDC_TRACER_ACCURACYSLIDER), 0, 100, 0, NULL));
00708     SetLongGadgetValue(_R(IDC_TRACER_ICTNUM),     GetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER), 0, 100, 0, NULL));
00709     SetLongGadgetValue(_R(IDC_TRACER_FCTNUM),     GetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER), 0, 100, 0, NULL));
00710     SetLongGadgetValue(_R(IDC_TRACER_SMOOTHNUM),  GetLongGadgetValue(_R(IDC_TRACER_SMOOTHSLIDER), 0, 100, 0, NULL));
00711     TraceMethod Method=GetTraceMethod();
00712     BOOL Mono=(Method == TRACEMETHOD_MONO);
00713 //  BOOL Limited=(Method == TRACEMETHOD_GREYSCALE) || (Method==TRACEMETHOD_256COL);
00714     BOOL TrueCol=(Method == TRACEMETHOD_TRUECOL);
00715     INT32 Passes = GetLongGadgetValue  (_R(IDC_TRACER_PASSESNUM),   0, 100, 0, NULL);
00716     if (Method != TRACEMETHOD_TRUECOL) Passes=1;
00717     
00718     EnableGadget(_R(IDC_TRACER_FCTNUM), !Mono);
00719     EnableGadget(_R(IDC_TRACER_FCTSLIDER), !Mono);
00720     EnableGadget(_R(IDC_TRACER_FCTTXT), !Mono);
00721     
00722     EnableGadget(_R(IDC_TRACER_ICTNUM), Passes>1);
00723     EnableGadget(_R(IDC_TRACER_ICTSLIDER), Passes>1);
00724     EnableGadget(_R(IDC_TRACER_ICTTXT), Passes>1);
00725     
00726     EnableGadget(_R(IDC_TRACER_PASSESNUM), TrueCol);
00727     EnableGadget(_R(IDC_TRACER_PASSESTXT), TrueCol);
00728 
00729     return TRUE;
00730 }

void TraceDlg::Remove24BitTempCopy  )  [protected]
 

Definition at line 281 of file tracedlg.cpp.

00282 {
00283     // Get the selected Document
00284     Document * pDoc = Document::GetSelected();
00285 
00286     // Get the bitmap list
00287     BitmapList* Bitmaps = NULL;
00288     if (pDoc)
00289     {
00290         Bitmaps = pDoc->GetBitmapList();
00291     }
00292 
00293     // Get the first bitmap out of the bitmap list
00294     KernelBitmap * pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00295     KernelBitmap * pTemp = NULL;
00296 
00297     BOOL DeleteThisBMP = FALSE;
00298 
00299     // If we`ve got a valid BMP then do some testing!
00300     while (pBmp != NULL)
00301     {
00302         // Get the first Copy Name from our list
00303         std::list< String_256 >::iterator Pos = m_p24BitCopyNames.begin();
00304 
00305         // While the Position and the BMP are both valid do the check!
00306         while(Pos != m_p24BitCopyNames.end() && pBmp != NULL)
00307         {
00308             // Check to see if the BMP`s name matches the one held in the copy list
00309             if (pBmp->GetName().CompareTo(*Pos) == 0)
00310             {
00311                 // Mark this BMP For deletion!
00312                 DeleteThisBMP = TRUE;
00313 
00314                 // Now break out of this while loop!
00315                 break;
00316             }
00317 
00318             // Get the next name from the copy name list
00319             Pos++;
00320         }
00321 
00322         // If this isn`t the one then get the next in the list!
00323         pTemp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00324 
00325         // If the flag has been set then delete it!
00326         if(DeleteThisBMP)
00327         {
00328             // Remove it, Detach it, delete it and then just for good measure NULL it!!!
00329             Bitmaps->RemoveItem(pBmp);
00330             pBmp->Detach();
00331             delete pBmp;
00332             pBmp = NULL;
00333 
00334             // Reset the Delete flag
00335             DeleteThisBMP = FALSE;
00336         }
00337 
00338         // Set the Current BMP with the Temp
00339         pBmp = pTemp;
00340     }
00341 
00342     // Finished with everything so make sure the list is totally empty!
00343     m_p24BitCopyNames.clear();
00344 }

BOOL TraceDlg::RenderBitmap ReDrawInfoType ExtraInfo,
KernelBitmap BitmapToUse
[protected]
 

Fills a renderable control with a bitmap.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
ExtraInfo - The structure that has the extra data we need to start rendering [INPUTS] BitmapToUse - The bitmap to render
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 992 of file tracedlg.cpp.

00993 {
00994     // Go get a render region
00995     DocRect VirtualSize(0, 0, ExtraInfo->dx, ExtraInfo->dy);
00996     RenderRegion* pRender = CreateGRenderRegion(&VirtualSize, ExtraInfo);
00997     if (pRender!=NULL)
00998     {
00999         DialogColourInfo RedrawColours;     // Get a supplier for default dlg colours
01000 
01001         // A Grey colour [...hmmm, it's not a very grey grey any more... oragnge more like]
01002         DocColour Grey(255,200,0);
01003 
01004         // Render the attributes and the a rectangle
01005         pRender->SaveContext();
01006         pRender->SetLineColour(COLOUR_TRANS);
01007 
01008             // Draw a rectangle to fill in the background - Fill with Dialogue Background colour
01009         pRender->SetFillColour(RedrawColours.DialogBack());
01010         pRender->DrawRect(&VirtualSize);
01011     
01012         if (BitmapToUse)
01013         {
01014 
01015             NodeBitmap NB;
01016             NodeBitmap * pNodeBitmap = &NB;
01017         
01018             if (!((pNodeBitmap == NULL) || (!pNodeBitmap->SetUpPath(12,12))))
01019             {
01020                 // Get a new bitmap object for this node.
01021                 pNodeBitmap->GetBitmapRef()->SetBitmap(BitmapToUse);
01022                         
01023                 ENSURE(pNodeBitmap->GetBitmap()->ActualBitmap != NULL, "No bitmap object found!");
01024         
01025                 DocRect BitmapSize(VirtualSize);
01026                 BitmapInfo BMInfo;
01027                 BitmapToUse->ActualBitmap->GetInfo(&BMInfo);
01028                 if (BMInfo.PixelWidth==0) BMInfo.PixelWidth=1;
01029                 if (BMInfo.PixelHeight==0) BMInfo.PixelHeight=1;
01030 
01031                 double BMAspect = ((double)(BMInfo.PixelWidth))/((double)(BMInfo.PixelHeight));
01032                 double RedrawAspect = ((double)(ExtraInfo->dx))/((double)(ExtraInfo->dy));
01033 
01034                 if (BMAspect>RedrawAspect)
01035                 {
01036                     // grey at top and bottom
01037                     INT32 NewHeight = (INT32)( 0.5 + ((double)(VirtualSize.Width()))/BMAspect);
01038                     if (NewHeight<1) NewHeight = 1;
01039                     BitmapSize.lo.y = (VirtualSize.Height()-NewHeight)/2;
01040                     BitmapSize.hi.y = BitmapSize.lo.y + NewHeight;
01041                 }
01042                 else
01043                 {
01044                     // grey on left and right
01045                     INT32 NewWidth = (INT32)( 0.5 + ((double)(VirtualSize.Height()))*BMAspect);
01046                     if (NewWidth<1) NewWidth = 1;
01047                     BitmapSize.lo.x = (VirtualSize.Width()-NewWidth)/2;
01048                     BitmapSize.hi.x = BitmapSize.lo.x + NewWidth;
01049                 }
01050 
01051                 // And set this in our bitmap node
01052                 pNodeBitmap->CreateShape(BitmapSize);
01053                     
01054                 pNodeBitmap->Render(pRender);
01055             }
01056         }
01057 
01058         pRender->RestoreContext();
01059 
01060         // Get rid of the render region
01061         DestroyGRenderRegion(pRender);
01062     }
01063     return TRUE;
01064 }

BOOL TraceDlg::SaveSettings INT32 *  pSettings  )  [protected]
 

Sets up the sliders to a settings bank.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
*pSettings points to area to save to [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 607 of file tracedlg.cpp.

00608 {
00609     pSettings[0]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_PASSESNUM)         ,0, 100, 0, NULL);
00610     pSettings[1]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_BLURSLIDER)        ,0, 100, 0, NULL); 
00611     pSettings[2]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_MINAREASLIDER) ,0, 100, 0, NULL); 
00612     pSettings[3]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER)         ,0, 100, 0, NULL); 
00613     pSettings[4]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER)         ,0, 100, 0, NULL); 
00614     pSettings[5]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_ACCURACYSLIDER)    ,0, 100, 0, NULL); 
00615     pSettings[6]=(INT32)GetLongGadgetValue(_R(IDC_TRACER_SMOOTHSLIDER)  ,0, 100, 0, NULL); 
00616     return TRUE;
00617 }

BOOL TraceDlg::SetStatus BOOL  Tracing = FALSE  )  [protected]
 

Makes status line reflect current status.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
Tracing = TRUE if tracing [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 535 of file tracedlg.cpp.

00536 {
00537     UINT32 theID = _R(IDS_TRACER_PROGRESSSTRING_BLANK);
00538     INT32 NumPaths=0;
00539     INT32 NumPoints=0;
00540     INT32 Percent=0;
00541     BOOL Done=FALSE;
00542     String_256 Temp;
00543     if (pTraceControl && pTraceControl->GetProgress(&Percent, &NumPaths, NULL, &NumPoints, &Done) && Percent)
00544     {
00545         if (Done)
00546         {
00547             theID = _R(IDS_TRACER_PROGRESSSTRING_DONE);
00548             Tracing=FALSE;
00549         }
00550         else
00551         {
00552             if (Tracing)
00553                 theID = _R(IDS_TRACER_PROGRESSSTRING_TRACING);
00554             else
00555                 theID = _R(IDS_TRACER_PROGRESSSTRING_ABORTED);
00556         }
00557     }
00558     Temp.MakeMsg(theID, NumPaths, NumPoints);
00559     SetStringGadgetValue(_R(IDC_TRACER_STATUSTEXT), Temp);
00560     EnableGadget(_R(IDOK), Done && (!Tracing));
00561     EnableGadget(_R(IDCANCEL), !Tracing);
00562     EnableGadget(_R(IDC_TRACER_TRACEBTN), !Tracing);
00563     EnableGadget(_R(IDC_TRACER_HELP), !Tracing);
00564     return TRUE;
00565 }

BOOL TraceDlg::SetTraceMethod TraceMethod  Method  )  [protected]
 

Sets the trace method.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE on success else false for failure

Errors: None at present

See also:
-

Definition at line 671 of file tracedlg.cpp.

00672 {
00673     switch (Method)
00674     {
00675         case TRACEMETHOD_MONO:
00676             SetSelectedValueIndex(_R(IDC_TRACER_METHOD), 0);
00677             break;
00678         case TRACEMETHOD_GREYSCALE:
00679             SetSelectedValueIndex(_R(IDC_TRACER_METHOD), 1);
00680             break;
00681         case TRACEMETHOD_256COL:
00682             SetSelectedValueIndex(_R(IDC_TRACER_METHOD), 2);
00683             break;
00684         case TRACEMETHOD_TRUECOL:
00685         default:
00686             SetSelectedValueIndex(_R(IDC_TRACER_METHOD), 3);
00687             break;
00688     }
00689     return TRUE;
00690 }

BOOL TraceDlg::WriteParams  )  [protected]
 

This is a temporary routine to put the values in the dialog into the TraceCtl.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94

Definition at line 743 of file tracedlg.cpp.

00744 {
00745     ERROR2IF((!pTraceControl), FALSE, "No TraceControl in WriteParams()");
00746     
00747     TraceMethod Method = TRACEMETHOD_TRUECOL;
00748     INT32 MinimumArea = 0;
00749     double MaximumInitialAreaErrorThreshold=0.0;
00750     double MinimumInitialAreaErrorThreshold=0.0;
00751     double InitialAreaErrorRatio=0.0;
00752     double MinGradFillError=0.0;
00753     double GradFillErrorRatio=0.0;
00754     double MinPixelError=0.0;
00755     double MaxPixelError=0.0;
00756     double PixelErrorRatio=0.0;
00757     double QuantColours=0.0;
00758     double Blur = 0.0;
00759     double Smooth=0.0;
00760 
00761     pTraceControl->GetParams(   &Method,
00762                                 &MinimumArea,
00763                                 &MaximumInitialAreaErrorThreshold,
00764                                 &MinimumInitialAreaErrorThreshold,
00765                                 &InitialAreaErrorRatio,
00766                                 &MinGradFillError,
00767                                 &GradFillErrorRatio,
00768                                 &MinPixelError,
00769                                 &MaxPixelError,
00770                                 &PixelErrorRatio,
00771                                 &QuantColours,
00772                                 &Blur,
00773                                 &Smooth
00774                                 );
00775 
00776 
00777     MinimumArea                         = GetLongGadgetValue  (_R(IDC_TRACER_MINAREASLIDER),    0, 100, 0, NULL);   
00778     MaximumInitialAreaErrorThreshold    = 0.01+0.003*(double)(GetLongGadgetValue(_R(IDC_TRACER_ICTSLIDER),      0, 100, 0, NULL));
00779     MinimumInitialAreaErrorThreshold    = 0.01+0.003*(double)(GetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER),      0, 100, 0, NULL));
00780     MaxPixelError                       = 0.45+0.16*(double)(100-GetLongGadgetValue(_R(IDC_TRACER_ACCURACYSLIDER),      0, 100, 0, NULL)); // Inversion intentional
00781     MinPixelError = MaxPixelError;
00782     Blur                                = (double)(GetLongGadgetValue(_R(IDC_TRACER_BLURSLIDER),        0, 100, 0, NULL));
00783     Smooth                              = (double)(GetLongGadgetValue(_R(IDC_TRACER_SMOOTHSLIDER),      0, 100, 0, NULL));
00784     QuantColours                        = 0.01*(double)(GetLongGadgetValue(_R(IDC_TRACER_FCTSLIDER),    0, 100, 0, NULL)); // Inversion intentional
00785     
00786     if (QuantColours<0) QuantColours=0;
00787     QuantColours=QuantColours*QuantColours; // spread it out a little at the low end (i.e. high end on the slider)
00788 
00789     INT32 Passes = GetLongGadgetValue  (_R(IDC_TRACER_PASSESNUM),   0, 100, 0, NULL);
00790     Method = GetTraceMethod();
00791     if (Method != TRACEMETHOD_TRUECOL) Passes=1;
00792 
00793     if (Passes<1) Passes=1;
00794     if (Passes>5) Passes=5;
00795     if (MaximumInitialAreaErrorThreshold<MinimumInitialAreaErrorThreshold*1.05)
00796         MaximumInitialAreaErrorThreshold=MinimumInitialAreaErrorThreshold*1.05;
00797     if (Passes==1)
00798     {
00799         MaximumInitialAreaErrorThreshold=MinimumInitialAreaErrorThreshold;
00800         InitialAreaErrorRatio = 0.5;
00801     }
00802     else
00803     {
00804         InitialAreaErrorRatio = exp ((1.0/(double)(Passes-1))*(log(MinimumInitialAreaErrorThreshold)-log(MaximumInitialAreaErrorThreshold)));
00805     }
00806     MinimumInitialAreaErrorThreshold *= 1.000000001; // For rounding
00807 
00808 
00809     TRACEUSER( "Alex", _T("MinimumArea=%d, MaxIE=%f, MinIE=%f, IEAR=%f, MaxPE=%f, Passes=%d\n"),
00810                 MinimumArea,
00811                 MaximumInitialAreaErrorThreshold,
00812                 MinimumInitialAreaErrorThreshold,
00813                 InitialAreaErrorRatio,
00814                 MaxPixelError,
00815                 Passes);
00816 
00817     pTraceControl->SetParams(   &Method,
00818                                 &MinimumArea,
00819                                 &MaximumInitialAreaErrorThreshold,
00820                                 &MinimumInitialAreaErrorThreshold,
00821                                 &InitialAreaErrorRatio,
00822                                 &MinGradFillError,
00823                                 &GradFillErrorRatio,
00824                                 &MinPixelError,
00825                                 &MaxPixelError,
00826                                 &PixelErrorRatio,
00827                                 &QuantColours,
00828                                 &Blur,
00829                                 &Smooth
00830                                 );
00831 
00832     return TRUE;
00833 }


Member Data Documentation

INT32 TraceDlg::DefaultMode = (INT32)TRACEMETHOD_TRUECOL [static, protected]
 

Definition at line 244 of file tracedlg.h.

INT32 TraceDlg::DefaultSetting = { {1, 50, 25, 50, 50, 80, 15}, {1, 50, 25, 50, 50, 50, 50}, {1, 50, 25, 65, 65, 50, 50}, {1, 50, 25, 25, 25, 50, 50} } [static, protected]
 

Definition at line 245 of file tracedlg.h.

INT32 TraceDlg::FactorySetting = { {1, 50, 25, 50, 50, 80, 15}, {1, 50, 25, 50, 50, 50, 50}, {1, 50, 25, 65, 65, 50, 50}, {1, 50, 25, 25, 25, 50, 50} } [static, protected]
 

Definition at line 246 of file tracedlg.h.

const UINT32 TraceDlg::IDD = _R(IDD_TRACEDLG) [static]
 

Definition at line 235 of file tracedlg.h.

std::list< String_256 > TraceDlg::m_p24BitCopyNames [protected]
 

Definition at line 230 of file tracedlg.h.

const CDlgMode TraceDlg::Mode = MODELESS [static]
 

Definition at line 236 of file tracedlg.h.

KernelBitmap* TraceDlg::pOriginal [protected]
 

Definition at line 240 of file tracedlg.h.

KernelBitmap* TraceDlg::pPrevOriginal [protected]
 

Definition at line 241 of file tracedlg.h.

TraceControl* TraceDlg::pTraceControl [protected]
 

Definition at line 242 of file tracedlg.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:06 2007 for Camelot by  doxygen 1.4.4