#include <ai_layer.h>
Inheritance diagram for AILayerProcessor:
Public Member Functions | |
AILayerProcessor (void) | |
Default constructor. | |
~AILayerProcessor (void) | |
Default destructor. | |
BOOL | DecodeAI5Lb (AI5EPSFilter &Filter) |
Extracts the layer information from the Lb record. The AI file format allows for more fine-grained control over the layers than the Camelot version, and so much of it is rejected. | |
BOOL | DecodeAI8Lb (AI5EPSFilter &Filter) |
The syntax of the Lb operator has changed in AI8, and this function is intended to handle the newer version. | |
BOOL | DecodeLB (AI5EPSFilter &Filter) |
Processes the LB command, which is the end of layer indicator. | |
BOOL | DecodeLn (AI5EPSFilter &Filter) |
Processes the Ln command, which is used to set the layer's name. | |
Private Attributes | |
String_256 | mLayerName |
BOOL | mIsLocked |
BOOL | mIsPrintable |
BOOL | mIsVisible |
The layer body is terminated by the LB tag.
Definition at line 121 of file ai_layer.h.
|
Default constructor.
Definition at line 116 of file ai_layer.cpp. 00117 { 00118 // Initialise all member variables to their default state. 00119 mLayerName.Empty (); // Clear the layer name string. 00120 mIsLocked = FALSE; // Set the layer locked flag to FALSE. 00121 mIsPrintable = FALSE; // Set the layer printable flag to FALSE. 00122 mIsVisible = FALSE; // Set the layer visible flag to FALSE. 00123 }
|
|
Default destructor.
Definition at line 136 of file ai_layer.cpp.
|
|
Extracts the layer information from the Lb record. The AI file format allows for more fine-grained control over the layers than the Camelot version, and so much of it is rejected.
Definition at line 158 of file ai_layer.cpp. 00159 { 00160 INT32 IsVisible = 0; 00161 INT32 IsLocked = 0; 00162 INT32 IsPrintable = 0; 00163 00164 // Pop the information off the stack. 00165 if ( !Filter.GetStack ().Discard ( 6 ) || // Discard the unused data on the stack. 00166 !Filter.GetStack ().Pop ( &IsPrintable ) || // Extract whether it's printable. 00167 !Filter.GetStack ().Pop ( &IsLocked ) || // Extract whether the layer is locked. 00168 !Filter.GetStack ().Discard ( 1 ) || // Discard the unused flag. 00169 !Filter.GetStack ().Pop ( &IsVisible ) ) // Extract the layer visibility data. 00170 { 00171 // There has been a problem extracting the data. Return a FALSE value to inform the 00172 // AIEPS filter. 00173 return FALSE; 00174 } 00175 00176 // Set up the layer state flags from the information in the Lb operator. The default 00177 // state is false, so only one branch needs to be evaluated. 00178 if ( !IsLocked ) 00179 { 00180 mIsLocked = TRUE; // Set the layer locked flag to TRUE. 00181 } 00182 00183 if ( IsPrintable ) 00184 { 00185 mIsPrintable = TRUE; // Set the printable flag to TRUE. 00186 } 00187 00188 if ( IsVisible ) 00189 { 00190 mIsVisible = TRUE; // Set the visible flag to TRUE. 00191 } 00192 00193 // Success. 00194 return TRUE; 00195 }
|
|
The syntax of the Lb operator has changed in AI8, and this function is intended to handle the newer version.
Definition at line 213 of file ai_layer.cpp. 00214 { 00215 INT32 IsVisible = 0; 00216 INT32 IsLocked = 0; 00217 INT32 IsPrintable = 0; 00218 00219 // Pop the information off the stack. 00220 if ( !Filter.GetStack ().Discard ( 9 ) || // Discard the unused data on the stack. 00221 !Filter.GetStack ().Pop ( &IsPrintable ) || // Extract whether it's printable. 00222 !Filter.GetStack ().Pop ( &IsLocked ) || // Extract whether the layer is locked. 00223 !Filter.GetStack ().Discard ( 1 ) || // Discard the unused flag. 00224 !Filter.GetStack ().Pop ( &IsVisible ) ) // Extract the layer visibility data. 00225 { 00226 // There has been a problem extracting the data. Return a FALSE value to inform the 00227 // AIEPS filter. 00228 return FALSE; 00229 } 00230 00231 // Set up the layer state flags from the information in the Lb operator. The default 00232 // state is false, so only one branch needs to be evaluated. 00233 if ( !IsLocked ) 00234 { 00235 mIsLocked = TRUE; // Set the layer locked flag to TRUE. 00236 } 00237 00238 if ( IsPrintable ) 00239 { 00240 mIsPrintable = TRUE; // Set the printable flag to TRUE. 00241 } 00242 00243 if ( IsVisible ) 00244 { 00245 mIsVisible = TRUE; // Set the visible flag to TRUE. 00246 } 00247 00248 // Success. 00249 return TRUE; 00250 }
|
|
Processes the LB command, which is the end of layer indicator.
Definition at line 266 of file ai_layer.cpp. 00267 { 00268 // Push the insert point in the tree up a level, so that any future layers are inserted 00269 // in the correct place. This is done automatically by the EPSFilter class, so this 00270 // method is redundant. 00271 return TRUE; 00272 }
|
|
Processes the Ln command, which is used to set the layer's name.
Definition at line 288 of file ai_layer.cpp. 00289 { 00290 // Pop the layer's name off the stack, and store it in the mLayerName member variable. 00291 if ( !Filter.GetStack ().Pop ( &mLayerName ) ) 00292 { 00293 // There's been a problem, so inform the filter that invoked this command. 00294 return FALSE; 00295 } 00296 00297 // Create a new layer using the stored information. 00298 return Filter.CreateLayer ( mLayerName, mIsLocked, mIsPrintable, mIsVisible ); 00299 }
|
|
Definition at line 137 of file ai_layer.h. |
|
Definition at line 138 of file ai_layer.h. |
|
Definition at line 139 of file ai_layer.h. |
|
Definition at line 136 of file ai_layer.h. |