00001 #include "stdafx.h"
00002
00003 #include "BON.h"
00004 #include "BONImpl.h"
00005
00006 #include "FCO.h"
00007 #include "ReferenceRep.h"
00008 #include "logger.h"
00009 #include "Token.h"
00010 #include "list"
00011 #include "algorithm"
00012 #include <iterator>
00013
00014 #include "globals.h"
00015 extern Globals global_vars;
00016
00017
00018 const std::string FCO::IsAbstract_str = "IsAbstract";
00019 const std::string FCO::Icon_str = "Icon";
00020 const std::string FCO::PortIcon_str = "PortIcon";
00021 const std::string FCO::Decorator_str = "Decorator";
00022 const std::string FCO::IsHotspotEnabled_str = "IsHotspotEnabled";
00023 const std::string FCO::IsTypeShown_str = "IsTypeShown";
00024 const std::string FCO::NamePosition_str = "NamePosition";
00025 const std::string FCO::SubTypeIcon_str = "SubTypeIcon";
00026 const std::string FCO::InstanceIcon_str = "InstanceIcon";
00027 const std::string FCO::NameWrapNum_str = "NameWrapNum";
00028 const std::string FCO::IsNameEnabled_str = "IsNameEnabled";
00029 const std::string FCO::IsResizable_str = "IsResizable";
00030 const std::string FCO::AutoRouterPref_str = "AutoRouterPref";
00031 const std::string FCO::HelpURL_str = "HelpURL";
00032 const std::string FCO::ShowPorts_str = "ShowPorts";
00033
00034 const std::string FCO::IsGradientFillEnabled_str = "IsGradientFillEnabled";
00035 const std::string FCO::GradientFillColor_str = "GradientFillColor";
00036 const std::string FCO::GradientFillDirection_str = "GradientFillDirection";
00037 const std::string FCO::IsShadowCastEnabled_str = "IsShadowCastEnabled";
00038 const std::string FCO::ShadowColor_str = "ShadowColor";
00039 const std::string FCO::ShadowThickness_str = "ShadowThickness";
00040 const std::string FCO::ShadowDirection_str = "ShadowDirection";
00041 const std::string FCO::IsRoundRectangleEnabled_str = "IsRoundRectangleEnabled";
00042 const std::string FCO::RoundRectangleRadius_str = "RoundRectangleRadius";
00043
00044 FCO::FCO( BON::FCO& ptr, BON::FCO& resp_ptr)
00045 : Any( ptr)
00046 , m_respPointer( resp_ptr)
00047 , m_isAbstract( false)
00048 , m_bAttrIsHotspotEnabled( true)
00049 , m_bAttrIsTypeShown( false)
00050 , m_bAttrIsNameEnabled( true)
00051 , m_bAttrIsResizable( false)
00052 , m_iAttrNamePosition( 0)
00053 , m_iAttrNameWrapNum( 0)
00054 , m_bAttrIsGradientFillEnabled( false)
00055 , m_iAttrGradientFillColor( RGB(0xC0,0xC0,0xC0))
00056 , m_iAttrGradientFillDirection( 0)
00057 , m_bAttrIsShadowCastEnabled( false)
00058 , m_iAttrShadowColor( RGB(0xC0,0xC0,0xC0))
00059 , m_iAttrShadowThickness( 9)
00060 , m_iAttrShadowDirection( 45)
00061 , m_bAttrIsRoundRectangleEnabled( false)
00062 , m_iAttrRoundRectangleRadius( 9)
00063 , m_references()
00064 , m_partOf()
00065 , m_partOfFinal()
00066 , m_initialAttributeList()
00067 , m_finalAttributeList()
00068 {
00069 for ( int i = 0; i < NUMBER_OF_INHERITANCES; ++i)
00070 {
00071 m_childList[i].clear();
00072 m_parentList[i].clear();
00073 m_ancestors[i].clear();
00074 m_descendants[i].clear();
00075 }
00076 }
00077
00078
00079 FCO::~FCO()
00080 {
00081 m_references.clear();
00082 m_partOf.clear();
00083 m_partOfFinal.clear();
00084 m_initialAttributeList.clear();
00085 m_finalAttributeList.clear();
00086
00087 for ( int i = 0; i < NUMBER_OF_INHERITANCES; ++i)
00088 {
00089 m_childList[i].clear();
00090 m_parentList[i].clear();
00091 m_ancestors[i].clear();
00092 m_descendants[i].clear();
00093 }
00094 }
00095
00096
00097 std::string FCO::getName() const
00098 {
00099 if( m_respPointer)
00100 {
00101 return m_namespace + (m_namespace.empty()?"":Any::NamespaceDelimiter_str) + m_respPointer->getName();
00102 }
00103 else
00104 {
00105 return m_namespace + (m_namespace.empty()?"":Any::NamespaceDelimiter_str) + m_ptr->getName();
00106 }
00107 }
00108
00109
00110 std::string FCO::getDispName() const
00111 {
00112 if( m_respPointer)
00113 {
00114
00115 return m_userSelectedDisplayName;
00116 }
00117 else
00118 {
00119 return m_sAttrDispName;
00120 }
00121 }
00122
00123
00124 void FCO::initAttributes()
00125 {
00126 m_isInRootFolder = m_isInRootFolder || m_ptr->getAttribute( InRootFolder_str)->getBooleanValue();
00127
00128
00129 bool isabs = true;
00130 bool isabs_set = false;
00131
00132 if( m_ptr->getAttribute( IsAbstract_str)->getStatus() >= BON::AS_Here)
00133 {
00134 isabs = isabs && m_ptr->getAttribute( IsAbstract_str)->getBooleanValue();
00135 isabs_set = true;
00136 }
00137
00138
00139 bool isgenpref_set = false;
00140 if( m_ptr->getAttribute( GeneralPreferences_str)->getStatus() >= BON::AS_Here)
00141 {
00142 m_sAttrGenPref = m_ptr->getAttribute( GeneralPreferences_str)->getStringValue();
00143 isgenpref_set = true;
00144 }
00145
00146
00147 bool isdispname_set = false;
00148 if( m_ptr->getAttribute( DisplayedName_str)->getStatus() >= BON::AS_Here)
00149 {
00150 m_sAttrDispName = m_ptr->getAttribute( DisplayedName_str)->getStringValue();
00151 isdispname_set = true;
00152 }
00153
00154
00155
00156 bool ishotspotenabled_set = false;
00157 if( m_ptr->getAttribute( IsHotspotEnabled_str)->getStatus() >= BON::AS_Here)
00158 {
00159 m_bAttrIsHotspotEnabled = m_ptr->getAttribute( IsHotspotEnabled_str)->getBooleanValue();
00160 ishotspotenabled_set = true;
00161
00162 }
00163
00164 bool istypeshown_set = false;
00165 if( m_ptr->getAttribute( IsTypeShown_str)->getStatus() >= BON::AS_Here)
00166 {
00167 m_bAttrIsTypeShown = m_ptr->getAttribute( IsTypeShown_str)->getBooleanValue();
00168 istypeshown_set = true;
00169 }
00170
00171
00172 bool isnameenabled_set = false;
00173 if( m_ptr->getAttribute( IsNameEnabled_str)->getStatus() >= BON::AS_Here)
00174 {
00175 m_bAttrIsNameEnabled = m_ptr->getAttribute( IsNameEnabled_str)->getBooleanValue();
00176 isnameenabled_set = true;
00177 }
00178
00179 bool isnamepos_set = false;
00180
00181 {
00182 m_iAttrNamePosition = m_ptr->getAttribute( NamePosition_str)->getIntegerValue();
00183 isnamepos_set = true;
00184 }
00185
00186 bool isnamewrapnum_set = false;
00187 if( m_ptr->getAttribute( NameWrapNum_str)->getStatus() >= BON::AS_Here)
00188 {
00189 m_iAttrNameWrapNum = m_ptr->getAttribute( NameWrapNum_str)->getIntegerValue();
00190 isnamewrapnum_set = true;
00191 }
00192
00193 bool icon_set = false;
00194 if( m_ptr->getAttribute( Icon_str)->getStatus() >= BON::AS_Here)
00195 {
00196 m_sAttrIcon = m_ptr->getAttribute( Icon_str)->getStringValue();
00197 icon_set = true;
00198 }
00199
00200 bool porticon_set = false;
00201 if( m_ptr->getAttribute( PortIcon_str)->getStatus() >= BON::AS_Here)
00202 {
00203 m_sAttrPortIcon = m_ptr->getAttribute( PortIcon_str)->getStringValue();
00204 porticon_set = true;
00205 }
00206
00207 bool subtypeicon_set = false;
00208 if( m_ptr->getAttribute( SubTypeIcon_str)->getStatus() >= BON::AS_Here)
00209 {
00210 m_sAttrSubTypeIcon = m_ptr->getAttribute( SubTypeIcon_str)->getStringValue();
00211 subtypeicon_set = true;
00212 }
00213
00214 bool instanceicon_set = false;
00215 if( m_ptr->getAttribute( InstanceIcon_str)->getStatus() >= BON::AS_Here)
00216 {
00217 m_sAttrInstanceIcon = m_ptr->getAttribute( InstanceIcon_str)->getStringValue();
00218 instanceicon_set = true;
00219 }
00220
00221 bool decorator_set = false;
00222 if( m_ptr->getAttribute( Decorator_str)->getStatus() >= BON::AS_Here)
00223 {
00224 m_sAttrDecorator = m_ptr->getAttribute( Decorator_str)->getStringValue();
00225 decorator_set = true;
00226 }
00227
00228 bool isresizable_set = false;
00229 if( m_ptr->getAttribute( IsResizable_str)->getStatus() >= BON::AS_Here)
00230 {
00231 m_bAttrIsResizable = m_ptr->getAttribute( IsResizable_str)->getBooleanValue();
00232 isresizable_set = true;
00233 }
00234
00235 bool autorouterpref_set = false;
00236 if( m_ptr->getAttribute( AutoRouterPref_str)->getStatus() >= BON::AS_Here)
00237 {
00238 m_sAttrAutoRouterPref = m_ptr->getAttribute( AutoRouterPref_str)->getStringValue();
00239 autorouterpref_set = true;
00240 }
00241
00242 bool helpurl_set = false;
00243 if( m_ptr->getAttribute( HelpURL_str)->getStatus() >= BON::AS_Here)
00244 {
00245 m_sAttrHelpURL = m_ptr->getAttribute( HelpURL_str)->getStringValue();
00246 helpurl_set = true;
00247 }
00248
00249 bool isgradientfillenabled_set = false;
00250 if( m_ptr->getAttribute( IsGradientFillEnabled_str)->getStatus() >= BON::AS_Here)
00251 {
00252 m_bAttrIsGradientFillEnabled = m_ptr->getAttribute( IsGradientFillEnabled_str)->getBooleanValue();
00253 isgradientfillenabled_set = true;
00254 }
00255
00256 bool gradientfillcolor_set = false;
00257 if( m_ptr->getAttribute( GradientFillColor_str)->getStatus() >= BON::AS_Here)
00258 {
00259 std::string tmpStr = m_ptr->getAttribute( GradientFillColor_str)->getStringValue();
00260 m_iAttrGradientFillColor = (COLORREF)strtoul(tmpStr.c_str(), NULL, 16);
00261 gradientfillcolor_set = true;
00262 }
00263
00264 bool gradientfilldirection_set = false;
00265 if( m_ptr->getAttribute( GradientFillDirection_str)->getStatus() >= BON::AS_Here)
00266 {
00267 m_iAttrGradientFillDirection = m_ptr->getAttribute( GradientFillDirection_str)->getIntegerValue();
00268 gradientfilldirection_set = true;
00269 }
00270
00271 bool isshadowcastenabled_set = false;
00272 if( m_ptr->getAttribute( IsShadowCastEnabled_str)->getStatus() >= BON::AS_Here)
00273 {
00274 m_bAttrIsShadowCastEnabled = m_ptr->getAttribute( IsShadowCastEnabled_str)->getBooleanValue();
00275 isshadowcastenabled_set = true;
00276 }
00277
00278 bool shadowcolor_set = false;
00279 if( m_ptr->getAttribute( ShadowColor_str)->getStatus() >= BON::AS_Here)
00280 {
00281 std::string tmpStr = m_ptr->getAttribute( ShadowColor_str)->getStringValue();
00282 m_iAttrShadowColor = (COLORREF)strtoul(tmpStr.c_str(), NULL, 16);
00283 shadowcolor_set = true;
00284 }
00285
00286 bool shadowthickness_set = false;
00287 if( m_ptr->getAttribute( ShadowThickness_str)->getStatus() >= BON::AS_Here)
00288 {
00289 m_iAttrShadowThickness = m_ptr->getAttribute( ShadowThickness_str)->getIntegerValue();
00290 shadowthickness_set = true;
00291 }
00292
00293 bool shadowdirection_set = false;
00294 if( m_ptr->getAttribute( ShadowDirection_str)->getStatus() >= BON::AS_Here)
00295 {
00296 m_iAttrShadowDirection = m_ptr->getAttribute( ShadowDirection_str)->getIntegerValue();
00297 shadowdirection_set = true;
00298 }
00299
00300 bool isroundrectangleenabled_set = false;
00301 if( m_ptr->getAttribute( IsRoundRectangleEnabled_str)->getStatus() >= BON::AS_Here)
00302 {
00303 m_bAttrIsRoundRectangleEnabled = m_ptr->getAttribute( IsRoundRectangleEnabled_str)->getBooleanValue();
00304 isroundrectangleenabled_set = true;
00305 }
00306
00307 bool roundrectangleradius_set = false;
00308 if( m_ptr->getAttribute( RoundRectangleRadius_str)->getStatus() >= BON::AS_Here)
00309 {
00310 m_iAttrRoundRectangleRadius = m_ptr->getAttribute( RoundRectangleRadius_str)->getIntegerValue();
00311 roundrectangleradius_set = true;
00312 }
00313
00314
00315
00316
00317
00318
00319 std::set< BON::FCO >::const_iterator it = m_equivs.begin();
00320 for ( ; it != m_equivs.end(); ++it)
00321 {
00322 if ( *it == m_ptr) continue;
00323
00324
00325
00326 m_isInRootFolder = m_isInRootFolder || (*it)->getAttribute( InRootFolder_str)->getBooleanValue();
00327
00328
00329
00330 if( (*it)->getAttribute( IsAbstract_str)->getStatus() >= BON::AS_Here)
00331 {
00332 isabs = isabs && (*it)->getAttribute( IsAbstract_str)->getBooleanValue();
00333 isabs_set = true;
00334 }
00335 #if(1)
00336
00337 if ( !isgenpref_set && (*it)->getAttribute( GeneralPreferences_str)->getStatus() >= BON::AS_Here)
00338 {
00339 m_sAttrGenPref = (*it)->getAttribute( GeneralPreferences_str)->getStringValue();
00340 isgenpref_set = true;
00341 }
00342
00343
00344 if ( !isdispname_set && (*it)->getAttribute( DisplayedName_str)->getStatus() >= BON::AS_Here)
00345 {
00346 m_sAttrDispName = (*it)->getAttribute( DisplayedName_str)->getStringValue();
00347 isdispname_set = true;
00348 }
00349
00350
00351 if ((*it)->getObjectMeta().name().find("Proxy") != std::string::npos) continue;
00352
00353 if( !ishotspotenabled_set && (*it)->getAttribute( IsHotspotEnabled_str)->getStatus() >= BON::AS_Here)
00354 {
00355 m_bAttrIsHotspotEnabled = m_bAttrIsHotspotEnabled || (*it)->getAttribute( IsHotspotEnabled_str)->getBooleanValue();
00356 ishotspotenabled_set = true;
00357 }
00358
00359 if( !istypeshown_set && (*it)->getAttribute( IsTypeShown_str)->getStatus() >= BON::AS_Here)
00360 {
00361 m_bAttrIsTypeShown = m_bAttrIsTypeShown || (*it)->getAttribute( IsTypeShown_str)->getBooleanValue();
00362 istypeshown_set = true;
00363 }
00364
00365 if( !isnameenabled_set && (*it)->getAttribute( IsNameEnabled_str)->getStatus() >= BON::AS_Here)
00366 {
00367 m_bAttrIsNameEnabled = m_bAttrIsNameEnabled || (*it)->getAttribute( IsNameEnabled_str)->getBooleanValue();
00368 isnameenabled_set = true;
00369 }
00370
00371
00372 if ( !isnamepos_set && (*it)->getAttribute( NamePosition_str)->getStatus() >= BON::AS_Here)
00373 {
00374 m_iAttrNamePosition = (*it)->getAttribute( NamePosition_str)->getIntegerValue();
00375 isnamepos_set = true;
00376 }
00377 if ( !isnamewrapnum_set && (*it)->getAttribute( NameWrapNum_str)->getStatus() >= BON::AS_Here)
00378 {
00379 m_iAttrNameWrapNum = (*it)->getAttribute( NameWrapNum_str)->getIntegerValue();
00380 isnamewrapnum_set = true;
00381 }
00382
00383
00384 if ( !icon_set && (*it)->getAttribute( Icon_str)->getStatus() >= BON::AS_Here)
00385 {
00386 m_sAttrIcon = (*it)->getAttribute( Icon_str)->getStringValue();
00387 icon_set = true;
00388 }
00389 if ( !porticon_set && (*it)->getAttribute( PortIcon_str)->getStatus() >= BON::AS_Here)
00390 {
00391 m_sAttrPortIcon = (*it)->getAttribute( PortIcon_str)->getStringValue();
00392 porticon_set = true;
00393 }
00394 if( !subtypeicon_set && (*it)->getAttribute( SubTypeIcon_str)->getStatus() >= BON::AS_Here)
00395 {
00396 m_sAttrSubTypeIcon = (*it)->getAttribute( SubTypeIcon_str)->getStringValue();
00397 subtypeicon_set = true;
00398 }
00399 if ( !instanceicon_set && (*it)->getAttribute( InstanceIcon_str)->getStatus() >= BON::AS_Here)
00400 {
00401 m_sAttrInstanceIcon = (*it)->getAttribute( InstanceIcon_str)->getStringValue();
00402 instanceicon_set = true;
00403 }
00404 if ( !decorator_set && (*it)->getAttribute( Decorator_str)->getStatus() >= BON::AS_Here)
00405 {
00406 m_sAttrDecorator = (*it)->getAttribute( Decorator_str)->getStringValue();
00407 decorator_set = true;
00408 }
00409
00410 if ( !isresizable_set && (*it)->getAttribute( IsResizable_str)->getStatus() >= BON::AS_Here)
00411 {
00412 m_bAttrIsResizable = (*it)->getAttribute( IsResizable_str)->getBooleanValue();
00413 isresizable_set = true;
00414 }
00415
00416 if ( !autorouterpref_set && (*it)->getAttribute( AutoRouterPref_str)->getStatus() >= BON::AS_Here)
00417 {
00418 m_sAttrAutoRouterPref = (*it)->getAttribute( AutoRouterPref_str)->getStringValue();
00419 autorouterpref_set = true;
00420 }
00421
00422 if ( !helpurl_set && (*it)->getAttribute( HelpURL_str)->getStatus() >= BON::AS_Here)
00423 {
00424 m_sAttrHelpURL = (*it)->getAttribute( HelpURL_str)->getStringValue();
00425 helpurl_set = true;
00426 }
00427
00428 if ( !isgradientfillenabled_set && (*it)->getAttribute( IsGradientFillEnabled_str)->getStatus() >= BON::AS_Here)
00429 {
00430 m_bAttrIsGradientFillEnabled = (*it)->getAttribute( IsGradientFillEnabled_str)->getBooleanValue();
00431 isgradientfillenabled_set = true;
00432 }
00433
00434 if ( !gradientfillcolor_set && (*it)->getAttribute( GradientFillColor_str)->getStatus() >= BON::AS_Here)
00435 {
00436 std::string tmpStr = (*it)->getAttribute( GradientFillColor_str)->getStringValue();
00437 m_iAttrGradientFillColor = (COLORREF)strtoul(tmpStr.c_str(), NULL, 16);
00438 gradientfillcolor_set = true;
00439 }
00440
00441 if ( !gradientfilldirection_set && (*it)->getAttribute( GradientFillDirection_str)->getStatus() >= BON::AS_Here)
00442 {
00443 m_iAttrGradientFillDirection = (*it)->getAttribute( GradientFillDirection_str)->getIntegerValue();
00444 gradientfilldirection_set = true;
00445 }
00446
00447 if ( !isshadowcastenabled_set && (*it)->getAttribute( IsShadowCastEnabled_str)->getStatus() >= BON::AS_Here)
00448 {
00449 m_bAttrIsShadowCastEnabled = (*it)->getAttribute( IsShadowCastEnabled_str)->getBooleanValue();
00450 isshadowcastenabled_set = true;
00451 }
00452
00453 if ( !shadowcolor_set && (*it)->getAttribute( ShadowColor_str)->getStatus() >= BON::AS_Here)
00454 {
00455 std::string tmpStr = (*it)->getAttribute( ShadowColor_str)->getStringValue();
00456 m_iAttrShadowColor = (COLORREF)strtoul(tmpStr.c_str(), NULL, 16);
00457 shadowcolor_set = true;
00458 }
00459
00460 if ( !shadowthickness_set && (*it)->getAttribute( ShadowThickness_str)->getStatus() >= BON::AS_Here)
00461 {
00462 m_iAttrShadowThickness = (*it)->getAttribute( ShadowThickness_str)->getIntegerValue();
00463 shadowthickness_set = true;
00464 }
00465
00466 if ( !shadowdirection_set && (*it)->getAttribute( ShadowDirection_str)->getStatus() >= BON::AS_Here)
00467 {
00468 m_iAttrShadowDirection = (*it)->getAttribute( ShadowDirection_str)->getIntegerValue();
00469 shadowdirection_set = true;
00470 }
00471
00472 if ( !isroundrectangleenabled_set && (*it)->getAttribute( IsRoundRectangleEnabled_str)->getStatus() >= BON::AS_Here)
00473 {
00474 m_bAttrIsRoundRectangleEnabled = (*it)->getAttribute( IsRoundRectangleEnabled_str)->getBooleanValue();
00475 isroundrectangleenabled_set = true;
00476 }
00477
00478 if ( !roundrectangleradius_set && (*it)->getAttribute( RoundRectangleRadius_str)->getStatus() >= BON::AS_Here)
00479 {
00480 m_iAttrRoundRectangleRadius = (*it)->getAttribute( RoundRectangleRadius_str)->getIntegerValue();
00481 roundrectangleradius_set = true;
00482 }
00483 #endif
00484 }
00485
00486 if( isabs_set) m_isAbstract = isabs;
00487
00488 }
00489
00490
00491 bool FCO::isAbstract() const
00492 {
00493 return m_isAbstract;
00494 }
00495
00496
00497 void FCO::abstract( bool is)
00498 {
00499 m_isAbstract = is;
00500 }
00501
00502
00503 void FCO::iAmPartOf( ModelRep * mod_ptr)
00504 {
00505 std::vector<ModelRep *>::iterator jt =
00506 std::find( m_partOf.begin(), m_partOf.end(), mod_ptr);
00507
00508
00509 if (jt == m_partOf.end())
00510 m_partOf.push_back( mod_ptr);
00511 else { }
00512 }
00513
00514
00515 void FCO::iAmPartOfFinal( ModelRep * mod_ptr)
00516 {
00517 std::vector<ModelRep *>::iterator jt =
00518 std::find( m_partOfFinal.begin(), m_partOfFinal.end(), mod_ptr);
00519
00520
00521 if (jt == m_partOfFinal.end() )
00522 m_partOfFinal.push_back( mod_ptr);
00523 else { }
00524 }
00525
00526
00527 const FCO::ModelRepPtrList& FCO::modelsIAmPartOf()
00528 {
00529 return m_partOf;
00530 }
00531
00532
00533 const FCO::ModelRepPtrList& FCO::modelsIAmPartOfFinal()
00534 {
00535 return m_partOfFinal;
00536 }
00537
00538
00539 bool FCO::amIPartOf(const ModelRep * mod_ptr) const
00540 {
00541 ModelRepPtrList_ConstIterator it =
00542 std::find( m_partOf.begin(), m_partOf.end(), mod_ptr);
00543 return ( it != m_partOf.end());
00544 }
00545
00546
00547 bool FCO::amIPartOfFinal(const ModelRep * mod_ptr) const
00548 {
00549 ModelRepPtrList_ConstIterator it =
00550 std::find( m_partOfFinal.begin(), m_partOfFinal.end(), mod_ptr);
00551
00552 return ( it != m_partOfFinal.end());
00553 }
00554
00555
00556
00557 bool FCO::checkIsPartOf()
00558 {
00559 return !m_partOf.empty();
00560 }
00561
00562
00563 bool FCO::checkIsPartOfFinal()
00564 {
00565 return !m_partOfFinal.empty();
00566 }
00567
00568
00569 bool FCO::checkInheritance()
00570 {
00571 bool same_kind = true;
00572 KIND_TYPE kind_type = getMyKind();
00573
00574 INHERITANCE_TYPE type[ NUMBER_OF_INHERITANCES ] ={ REGULAR, INTERFACE, IMPLEMENTATION};
00575 for(int i = 0; i < NUMBER_OF_INHERITANCES && same_kind; ++i)
00576 {
00577 INHERITANCE_TYPE inh_type = type[i];
00578 std::vector<FCO*> * vectors[] = {
00579 &m_childList[inh_type],
00580 &m_parentList[inh_type],
00581 &m_ancestors[inh_type],
00582 &m_descendants[inh_type]
00583 };
00584 for(int k = 0; k < 4 && same_kind; ++k)
00585 {
00586 std::vector<FCO*>::iterator it = vectors[k]->begin();
00587 for( ; it != vectors[k]->end() && same_kind; ++it)
00588 if ((*it)->getMyKind() != FCO_REP)
00589 same_kind = same_kind && kind_type == (*it)->getMyKind();
00590 }
00591 }
00592 if (!same_kind)
00593 global_vars.err << MSG_ERROR << m_ptr << " fco has another kind of ancestor or descendant.\n";
00594 return same_kind;
00595 }
00596
00597
00598
00599 void FCO::addRefersToMe( ReferenceRep * ref_obj)
00600 {
00601 m_references.push_back( ref_obj);
00602 }
00603
00604
00605 const FCO::ReferenceRepList& FCO::getReferences() const
00606 {
00607 return m_references;
00608 }
00609
00610
00611 void FCO::addFinalRefersToMe( ReferenceRep * ref_obj)
00612 {
00613 if( std::find( m_finalReferences.begin(), m_finalReferences.end(), ref_obj) == m_finalReferences.end())
00614 m_finalReferences.push_back( ref_obj);
00615 }
00616
00617
00618 const FCO::ReferenceRepList& FCO::getFinalReferences() const
00619 {
00620 return m_finalReferences;
00621 }
00622
00623
00624
00625
00626
00627
00628
00629 FCO::ReferenceRepList FCO::getTransitiveReferencesToMe() const
00630 {
00631 ReferenceRepList multiple_refs = this->getFinalReferences();
00632 std::list< ReferenceRep * > ref_list;
00633 ref_list.insert( ref_list.end(), multiple_refs.begin(), multiple_refs.end());
00634
00635 while ( !ref_list.empty())
00636 {
00637 ReferenceRep * r = *ref_list.begin();
00638 ref_list.pop_front();
00639 std::vector< ReferenceRep *> temp = r->getFinalReferences();
00640
00641 std::vector<ReferenceRep *>::iterator temp_it = temp.begin();
00642 for( ; temp_it != temp.end(); ++temp_it)
00643 {
00644 if( std::find( multiple_refs.begin(), multiple_refs.end(), *temp_it) == multiple_refs.end())
00645 {
00646 multiple_refs.push_back( *temp_it);
00647 ref_list.push_back( *temp_it);
00648 }
00649 }
00650 }
00651 return multiple_refs;
00652 }
00653
00654
00655
00656
00657
00658 void FCO::addParent( INHERITANCE_TYPE type, FCO * ptr)
00659 {
00660
00661
00662 std::vector<FCO *>::iterator jt =
00663 std::find( m_parentList[type].begin(), m_parentList[type].end(), ptr);
00664
00665
00666 if (jt == m_parentList[type].end())
00667 m_parentList[type].push_back( ptr);
00668 else
00669 {
00670 global_vars.err << MSG_WARNING << "CHECK: " << (*jt)->getPtr() <<
00671 " base class is two times in direct inheritance " <<
00672 " relation with the derived class " <<
00673 m_ptr << "\n";
00674 }
00675 }
00676
00677
00678 void FCO::addChild( INHERITANCE_TYPE type, FCO * ptr)
00679 {
00680 std::vector<FCO *>::iterator jt =
00681 std::find( m_childList[type].begin(), m_childList[type].end(), ptr);
00682
00683
00684 if (jt == m_childList[type].end())
00685 m_childList[type].push_back( ptr);
00686 else
00687 { }
00688 }
00689
00690
00691 const std::vector<FCO *>& FCO::getParents( INHERITANCE_TYPE type)
00692 {
00693 return m_parentList[type];
00694 }
00695
00696
00697 const std::vector<FCO *>& FCO::getChildren( INHERITANCE_TYPE type)
00698 {
00699 return m_childList[type];
00700 }
00701
00702
00703 bool FCO::hasParent( const FCO * par, INHERITANCE_TYPE type) const
00704 {
00705 bool has = false;
00706 if ( type != REGULAR)
00707 {
00708 std::vector<FCO*>::const_iterator it =
00709 std::find( m_parentList[REGULAR].begin(), m_parentList[REGULAR].end(), par);
00710
00711 if ( it != m_parentList[REGULAR].end())
00712 has = has || true;
00713 }
00714 if (has) return has;
00715
00716 std::vector<FCO*>::const_iterator it =
00717 std::find( m_parentList[type].begin(), m_parentList[type].end(), par);
00718
00719 if ( it != m_parentList[type].end())
00720 has = has || true;
00721
00722 return has;
00723 }
00724
00725
00726 void FCO::setAncestors( INHERITANCE_TYPE type, const std::vector<FCO*> &anc_list)
00727 {
00728 ASSERT( type != REGULAR);
00729
00730
00731 m_ancestors[type].clear();
00732 m_ancestors[type].insert( m_ancestors[type].end(), anc_list.begin(), anc_list.end());
00733 }
00734
00735
00736 void FCO::setDescendants( INHERITANCE_TYPE type, const std::vector<FCO*> &desc_list)
00737 {
00738 ASSERT( type != REGULAR);
00739
00740
00741 m_descendants[type].clear();
00742 m_descendants[type].insert( m_descendants[type].end(), desc_list.begin(), desc_list.end());
00743 }
00744
00745
00746 void FCO::getIntAncestors( std::vector<FCO*> & ancestors) const
00747 {
00748 ancestors.insert( ancestors.end(), m_ancestors[INTERFACE].begin(), m_ancestors[INTERFACE].end());
00749 }
00750
00751
00752 void FCO::getIntDescendants( std::vector<FCO*> & descendants) const
00753 {
00754 descendants.insert( descendants.end(), m_descendants[INTERFACE].begin(), m_descendants[INTERFACE].end());
00755 }
00756
00757
00758 void FCO::getImpAncestors( std::vector<FCO*> & ancestors) const
00759 {
00760 ancestors.insert( ancestors.end(), m_ancestors[IMPLEMENTATION].begin(), m_ancestors[IMPLEMENTATION].end());
00761 }
00762
00763
00764 void FCO::getImpDescendants( std::vector<FCO*> & descendants) const
00765 {
00766 descendants.insert( descendants.end(), m_descendants[IMPLEMENTATION].begin(), m_descendants[IMPLEMENTATION].end());
00767 }
00768
00769
00770 const FCO::AttributeRepPtrList& FCO::getInitialAttributeRepPtrList() const
00771 {
00772 return m_initialAttributeList;
00773 }
00774
00775
00776 void FCO::addInitialAttribute( AttributeRep * attr)
00777 {
00778 AttributeRepPtrList_ConstIterator it =
00779 std::find( m_initialAttributeList.begin(), m_initialAttributeList.end(), attr);
00780
00781 if ( it == m_initialAttributeList.end())
00782 m_initialAttributeList.push_back( attr);
00783 else
00784 global_vars.err << MSG_ERROR << attr->getPtr() << " attribute owned by " << m_ptr << " twice\n";
00785 }
00786
00787
00788 void FCO::addFinalAttribute( AttributeRep * attr)
00789 {
00790 AttributeRepPtrList_ConstIterator it =
00791 std::find( m_finalAttributeList.begin(), m_finalAttributeList.end(), attr);
00792
00793 if ( it == m_finalAttributeList.end())
00794 m_finalAttributeList.push_back( attr);
00795
00796
00797 }
00798
00799
00800 void FCO::addFinalAttributeList(const AttributeRepPtrList& t_list)
00801 {
00802 AttributeRepPtrList_ConstIterator it_pos = t_list.begin();
00803 for( ; it_pos != t_list.end(); ++it_pos)
00804 addFinalAttribute( *it_pos);
00805 }
00806
00807 bool FCO::findFinalAttributeBasedOnName( const std::string & name)
00808 {
00809 AttributeRepPtrList_Iterator it;
00810 it = m_finalAttributeList.begin();
00811 while( it != m_finalAttributeList.end() && !((*it)->getName() == name ))
00812 ++it;
00813 return ( it != m_finalAttributeList.end());
00814 }
00815
00816
00817
00818 std::string FCO::dumpAttributes()
00819 {
00820 std::string mmm = "";
00821 AttributeRepPtrList_Iterator it;
00822
00823 AnyLexicographicSort lex;
00824 std::string last_name = "";
00825 std::sort( m_finalAttributeList.begin(), m_finalAttributeList.end(), lex );
00826
00827 it = m_finalAttributeList.begin();
00828 for( ; it != m_finalAttributeList.end(); ++it)
00829 if ( !(*it)->isGlobal())
00830 {
00831
00832 mmm += (*it)->doDumpAttr( getName());
00833 if ( last_name != "" && last_name == (*it)->getName())
00834 global_vars.err << MSG_ERROR << "Duplicate attribute name " << (*it)->getPtr() << " found for " << m_ptr << "\n";
00835 last_name = (*it)->getName();
00836 }
00837
00838 return mmm;
00839 }
00840
00841
00842
00843 std::string FCO::dumpAttributeList( bool check_viewable )
00844 {
00845 std::string mmm = "";
00846
00847 std::vector<AttributeRep*> temp_list;
00848 std::copy_if(m_finalAttributeList.begin(), m_finalAttributeList.end(),
00849 std::back_inserter(temp_list), [&](AttributeRep* p) { return !check_viewable || p->isViewable(); });
00850 std::sort(temp_list.begin(), temp_list.end(), [](AttributeRep* a, AttributeRep* b) { return a->lessThan(b); });
00851
00852 if ( !temp_list.empty())
00853 {
00854 mmm = " attributes = \"";
00855 std::vector<AttributeRep*>::iterator t_it;
00856 for( t_it = temp_list.begin(); t_it != temp_list.end(); ++t_it)
00857 {
00858 if (t_it != temp_list.begin()) mmm += " ";
00859 mmm += (*t_it)->getName();
00860 }
00861 mmm += "\"";
00862 }
00863 return mmm;
00864 }
00865
00866
00867 std::string FCO::dumpIcon()
00868 {
00869 std::string mmm;
00870 std::vector<FCO*> ancestors;
00871 getImpAncestors( ancestors);
00872 std::vector<FCO*>::iterator it = ancestors.begin();
00873 for( ; it != ancestors.end(); ++it)
00874 {
00875 mmm += (*it)->dumpIcon();
00876 }
00877
00878
00879 {
00880 std::string &icon = m_sAttrIcon;
00881
00882 if( !icon.empty())
00883 mmm += indStr() + "<regnode name = \"icon\" value =\"" + icon + "\"></regnode>\n";
00884 }
00885 return mmm;
00886 }
00887
00888
00889 std::string FCO::dumpPortIcon()
00890 {
00891 std::string mmm;
00892 std::vector<FCO*> ancestors;
00893 getImpAncestors( ancestors);
00894 std::vector<FCO*>::iterator it = ancestors.begin();
00895 for( ; it != ancestors.end(); ++it)
00896 {
00897 mmm += (*it)->dumpPortIcon();
00898 }
00899
00900
00901 {
00902 std::string &icon = m_sAttrPortIcon;
00903
00904 if( !icon.empty())
00905 mmm += indStr() + "<regnode name = \"porticon\" value =\"" + icon + "\"></regnode>\n";
00906 }
00907 return mmm;
00908 }
00909
00910
00911 std::string FCO::dumpDecorator()
00912 {
00913 std::string mmm;
00914 std::vector<FCO*> ancestors;
00915 getImpAncestors( ancestors);
00916 std::vector<FCO*>::iterator it = ancestors.begin();
00917 for( ; it != ancestors.end(); ++it)
00918 {
00919 mmm += (*it)->dumpDecorator();
00920 }
00921
00922
00923 {
00924 std::string &icon = m_sAttrDecorator;
00925
00926 if( !icon.empty())
00927 mmm += indStr() + "<regnode name = \"decorator\" value =\"" + icon + "\"></regnode>\n";
00928 }
00929 return mmm;
00930
00931 }
00932
00933
00934 std::string FCO::dumpHotspotEnabled()
00935 {
00936 std::string mmm;
00937 std::vector<FCO*> ancestors;
00938 getImpAncestors( ancestors);
00939 std::vector<FCO*>::iterator it = ancestors.begin();
00940 for( ; it != ancestors.end(); ++it)
00941 {
00942 mmm += (*it)->dumpHotspotEnabled();
00943 }
00944
00945
00946 {
00947 bool &icon = m_bAttrIsHotspotEnabled;
00948
00949 if( !icon)
00950 mmm += indStr() + "<regnode name = \"isHotspotEnabled\" value =\"false\"></regnode>\n";
00951 }
00952 return mmm;
00953 }
00954
00955
00956 std::string FCO::dumpTypeShown()
00957 {
00958 std::string mmm;
00959 std::vector<FCO*> ancestors;
00960 getImpAncestors( ancestors);
00961 std::vector<FCO*>::iterator it = ancestors.begin();
00962 for( ; it != ancestors.end(); ++it)
00963 {
00964 mmm += (*it)->dumpTypeShown();
00965 }
00966
00967
00968 {
00969 bool &icon = m_bAttrIsTypeShown;
00970
00971 if( icon)
00972 mmm += indStr() + "<regnode name = \"isTypeShown\" value =\"true\"></regnode>\n";
00973 }
00974 return mmm;
00975 }
00976
00977
00978
00979 std::string Any::dumpGeneralPref()
00980 {
00981 std::string mmm;
00982 std::vector<Any*> ancestors = getGeneralPrefAncestors();
00983 std::vector<Any*>::iterator it = ancestors.begin();
00984 for( ; it != ancestors.end(); ++it)
00985 {
00986 mmm += (*it)->dumpGeneralPref();
00987 }
00988
00989
00990 {
00991 std::string &prefs_1 = m_sAttrGenPref;
00992
00993 if (prefs_1.empty()) return mmm;
00994
00995 bool berr = false;
00996
00997 std::string prefs = prefs_1;
00998
00999 std::vector< std::string > prefArr;
01000
01001 Tokenizer tok;
01002
01003 tok.split( prefs, _T("\n"), prefArr);
01004
01005 for (int i = 0; i < prefArr.size(); i++) {
01006
01007 std::vector< std::string > prefPair;
01008
01009 tok.split( prefArr[i], _T("="), prefPair);
01010
01011
01012 if (prefPair.size() != 2) {
01013
01014 prefPair.clear();
01015
01016 tok.split( prefArr[i], _T(","), prefPair);
01017
01018 if (prefPair.size() == 2) {
01019 global_vars.err << MSG_WARNING << "Warning: Deprecated general preferences format for " << m_ptr << ".\n" << MSG_NORMAL << "Valid format:\n\t<prefname1> = <value1>\n\t<prefname2> = <value2>\n\t...\n";
01020 }
01021 }
01022
01023 if (prefPair.size() == 2) {
01024
01025 tok.trimLeft( prefPair[0]);
01026
01027 tok.trimRight( prefPair[0]);
01028
01029 tok.trimLeft( prefPair[1]);
01030
01031 tok.trimRight( prefPair[1]);
01032
01033 if( prefPair[0].empty())
01034 global_vars.err << MSG_ERROR << "Empty General Preference token found at " << m_ptr << " with \"" << prefPair[1] << "\" as value.\n";
01035 else
01036 mmm += indStr() + "<regnode name = \"" + prefPair[0] + "\" value =\"" + prefPair[1] + "\"></regnode>\n";
01037 }
01038 else {
01039 berr = true;
01040 break;
01041 }
01042 }
01043 if(berr) {
01044 global_vars.err << MSG_ERROR << "Invalid general preferences specification for " << m_ptr << ".\n"
01045 << MSG_NORMAL << "Valid format:\n\t<prefname1> = <value1>\n\t<prefname2> = <value2>\n\t...\n";
01046 }
01047 }
01048 return mmm;
01049 }
01050
01051
01052 std::string FCO::dumpNamePosition() const
01053 {
01054 CString p;
01055
01056 {
01057 int name_pos = min(8,max(0,m_iAttrNamePosition));
01058 p.Format("%ld", name_pos);
01059 }
01060
01061 return indStr() + "<regnode name = \"namePosition\" value =\"" + (const char*)p +"\">" + "</regnode>\n";
01062 }
01063
01064
01065 std::string FCO::dumpSubTypeIcon() const
01066 {
01067 std::string mmm;
01068 std::vector<FCO*> ancestors;
01069 getImpAncestors( ancestors);
01070 std::vector<FCO*>::iterator it = ancestors.begin();
01071 for( ; it != ancestors.end(); ++it)
01072 {
01073 mmm += (*it)->dumpSubTypeIcon();
01074 }
01075
01076
01077 {
01078 const std::string &icon = m_sAttrSubTypeIcon;
01079
01080 if( !icon.empty())
01081 mmm += indStr() + "<regnode name = \"subTypeIcon\" value =\"" + icon + "\"></regnode>\n";
01082 }
01083 return mmm;
01084 }
01085
01086
01087 std::string FCO::dumpInstanceIcon() const
01088 {
01089 std::string mmm;
01090 std::vector<FCO*> ancestors;
01091 getImpAncestors( ancestors);
01092 std::vector<FCO*>::iterator it = ancestors.begin();
01093 for( ; it != ancestors.end(); ++it)
01094 {
01095 mmm += (*it)->dumpInstanceIcon();
01096 }
01097
01098
01099 {
01100 const std::string &icon = m_sAttrInstanceIcon;
01101
01102 if( !icon.empty())
01103 mmm += indStr() + "<regnode name = \"instanceIcon\" value =\"" + icon + "\"></regnode>\n";
01104 }
01105 return mmm;
01106 }
01107
01108
01109 std::string FCO::dumpNameWrap() const
01110 {
01111 std::string mmm;
01112 std::vector<FCO*> ancestors;
01113 getImpAncestors( ancestors);
01114 std::vector<FCO*>::iterator it = ancestors.begin();
01115 for( ; it != ancestors.end(); ++it)
01116 {
01117 mmm += (*it)->dumpNameWrap();
01118 }
01119
01120
01121 {
01122 const int &icon = m_iAttrNameWrapNum;
01123 CString p;
01124 p.Format("%ld", icon);
01125 if( icon != 0)
01126 mmm += indStr() + "<regnode name = \"nameWrap\" value =\"" + (const char*)p + "\"></regnode>\n";
01127 }
01128 return mmm;
01129 }
01130
01131
01132 std::string FCO::dumpNameEnabled() const
01133 {
01134 std::string mmm;
01135 std::vector<FCO*> ancestors;
01136 getImpAncestors( ancestors);
01137 std::vector<FCO*>::iterator it = ancestors.begin();
01138 for( ; it != ancestors.end(); ++it)
01139 {
01140 mmm += (*it)->dumpNameEnabled();
01141 }
01142
01143
01144 {
01145 const bool &icon = m_bAttrIsNameEnabled;
01146
01147 if( !icon)
01148 mmm += indStr() + "<regnode name = \"isNameEnabled\" value =\"false\"></regnode>\n";
01149 }
01150 return mmm;
01151 }
01152
01153
01154 std::string FCO::dumpResizable() const
01155 {
01156 std::string mmm;
01157 std::vector<FCO*> ancestors;
01158 getImpAncestors( ancestors);
01159 std::vector<FCO*>::iterator it = ancestors.begin();
01160 for( ; it != ancestors.end(); ++it)
01161 {
01162 mmm += (*it)->dumpResizable();
01163 }
01164
01165
01166 {
01167 bool enabled = m_bAttrIsResizable;
01168
01169 if( enabled)
01170 mmm += indStr() + "<regnode name = \"itemResizable\" value =\"true\"></regnode>\n";
01171 }
01172 return mmm;
01173 }
01174
01175
01176 std::string FCO::dumpAutoRouterPref() const
01177 {
01178 std::string mmm;
01179 std::vector<FCO*> ancestors;
01180 getImpAncestors( ancestors);
01181 std::vector<FCO*>::iterator it = ancestors.begin();
01182 for( ; it != ancestors.end(); ++it)
01183 {
01184 mmm += (*it)->dumpAutoRouterPref();
01185 }
01186
01187
01188 {
01189 const std::string &formatStr = m_sAttrAutoRouterPref;
01190
01191 if( !formatStr.empty())
01192 mmm += indStr() + "<regnode name = \"autorouterPref\" value =\"" + formatStr + "\"></regnode>\n";
01193 }
01194 return mmm;
01195 }
01196
01197
01198 std::string FCO::dumpHelpURL() const
01199 {
01200 std::string mmm;
01201 std::vector<FCO*> ancestors;
01202 getImpAncestors( ancestors);
01203 std::vector<FCO*>::iterator it = ancestors.begin();
01204 for( ; it != ancestors.end(); ++it)
01205 {
01206 mmm += (*it)->dumpHelpURL();
01207 }
01208
01209
01210 {
01211 const std::string &helpURL = m_sAttrHelpURL;
01212
01213 if( !helpURL.empty())
01214 mmm += indStr() + "<regnode name = \"help\" value =\"" + helpURL + "\"></regnode>\n";
01215 }
01216 return mmm;
01217 }
01218
01219
01220 std::string FCO::dumpGradientFillEnabled() const
01221 {
01222 std::string mmm;
01223 std::vector<FCO*> ancestors;
01224 getImpAncestors( ancestors);
01225 std::vector<FCO*>::iterator it = ancestors.begin();
01226 for( ; it != ancestors.end(); ++it)
01227 {
01228 mmm += (*it)->dumpGradientFillEnabled();
01229 }
01230
01231
01232 {
01233 bool enabled = m_bAttrIsGradientFillEnabled;
01234
01235 if( enabled)
01236 mmm += indStr() + "<regnode name = \"gradientFill\" value =\"true\"></regnode>\n";
01237 }
01238 return mmm;
01239 }
01240
01241
01242 std::string FCO::dumpGradientFillColor() const
01243 {
01244 std::string mmm;
01245 std::vector<FCO*> ancestors;
01246 getImpAncestors( ancestors);
01247 std::vector<FCO*>::iterator it = ancestors.begin();
01248 for( ; it != ancestors.end(); ++it)
01249 {
01250 mmm += (*it)->dumpGradientFillColor();
01251 }
01252
01253
01254 {
01255 const unsigned int color = (unsigned int)m_iAttrGradientFillColor;
01256 CString p;
01257 p.Format("0x%06x", color);
01258 if( m_iAttrGradientFillColor != RGB(0xC0,0xC0,0xC0))
01259 mmm += indStr() + "<regnode name = \"gradientColor\" value =\"" + (const char*)p + "\"></regnode>\n";
01260 }
01261 return mmm;
01262 }
01263
01264
01265 std::string FCO::dumpGradientFillDirection() const
01266 {
01267 std::string mmm;
01268 std::vector<FCO*> ancestors;
01269 getImpAncestors( ancestors);
01270 std::vector<FCO*>::iterator it = ancestors.begin();
01271 for( ; it != ancestors.end(); ++it)
01272 {
01273 mmm += (*it)->dumpGradientFillDirection();
01274 }
01275
01276
01277 {
01278 const int direction = m_iAttrGradientFillDirection;
01279 CString p;
01280 p.Format("%ld", direction);
01281 if( direction != 0)
01282 mmm += indStr() + "<regnode name = \"gradientDirection\" value =\"" + (const char*)p + "\"></regnode>\n";
01283 }
01284 return mmm;
01285 }
01286
01287
01288 std::string FCO::dumpShadowCastEnabled() const
01289 {
01290 std::string mmm;
01291 std::vector<FCO*> ancestors;
01292 getImpAncestors( ancestors);
01293 std::vector<FCO*>::iterator it = ancestors.begin();
01294 for( ; it != ancestors.end(); ++it)
01295 {
01296 mmm += (*it)->dumpShadowCastEnabled();
01297 }
01298
01299
01300 {
01301 bool enabled = m_bAttrIsShadowCastEnabled;
01302
01303 if( enabled)
01304 mmm += indStr() + "<regnode name = \"itemShadowCast\" value =\"true\"></regnode>\n";
01305 }
01306 return mmm;
01307 }
01308
01309
01310 std::string FCO::dumpShadowColor() const
01311 {
01312 std::string mmm;
01313 std::vector<FCO*> ancestors;
01314 getImpAncestors( ancestors);
01315 std::vector<FCO*>::iterator it = ancestors.begin();
01316 for( ; it != ancestors.end(); ++it)
01317 {
01318 mmm += (*it)->dumpShadowColor();
01319 }
01320
01321
01322 {
01323 const unsigned int color = (unsigned int)m_iAttrShadowColor;
01324 CString p;
01325 p.Format("0x%06x", color);
01326 if( m_iAttrShadowColor != RGB(0xC0,0xC0,0xC0))
01327 mmm += indStr() + "<regnode name = \"shadowColor\" value =\"" + (const char*)p + "\"></regnode>\n";
01328 }
01329 return mmm;
01330 }
01331
01332
01333 std::string FCO::dumpShadowThickness() const
01334 {
01335 std::string mmm;
01336 std::vector<FCO*> ancestors;
01337 getImpAncestors( ancestors);
01338 std::vector<FCO*>::iterator it = ancestors.begin();
01339 for( ; it != ancestors.end(); ++it)
01340 {
01341 mmm += (*it)->dumpShadowThickness();
01342 }
01343
01344
01345 {
01346 const int thickness = m_iAttrShadowThickness;
01347 CString p;
01348 p.Format("%ld", thickness);
01349 if( thickness != 9)
01350 mmm += indStr() + "<regnode name = \"shadowThickness\" value =\"" + (const char*)p + "\"></regnode>\n";
01351 }
01352 return mmm;
01353 }
01354
01355
01356 std::string FCO::dumpShadowDirection() const
01357 {
01358 std::string mmm;
01359 std::vector<FCO*> ancestors;
01360 getImpAncestors( ancestors);
01361 std::vector<FCO*>::iterator it = ancestors.begin();
01362 for( ; it != ancestors.end(); ++it)
01363 {
01364 mmm += (*it)->dumpShadowDirection();
01365 }
01366
01367
01368 {
01369 const int direction = m_iAttrShadowDirection;
01370 CString p;
01371 p.Format("%ld", direction);
01372 if( direction != 45)
01373 mmm += indStr() + "<regnode name = \"shadowDirection\" value =\"" + (const char*)p + "\"></regnode>\n";
01374 }
01375 return mmm;
01376 }
01377
01378
01379 std::string FCO::dumpRoundRectangleEnabled() const
01380 {
01381 std::string mmm;
01382 std::vector<FCO*> ancestors;
01383 getImpAncestors( ancestors);
01384 std::vector<FCO*>::iterator it = ancestors.begin();
01385 for( ; it != ancestors.end(); ++it)
01386 {
01387 mmm += (*it)->dumpRoundRectangleEnabled();
01388 }
01389
01390
01391 {
01392 bool enabled = m_bAttrIsRoundRectangleEnabled;
01393
01394 if( enabled)
01395 mmm += indStr() + "<regnode name = \"roundCornerRect\" value =\"true\"></regnode>\n";
01396 }
01397 return mmm;
01398 }
01399
01400
01401 std::string FCO::dumpRoundRectangleRadius() const
01402 {
01403 std::string mmm;
01404 std::vector<FCO*> ancestors;
01405 getImpAncestors( ancestors);
01406 std::vector<FCO*>::iterator it = ancestors.begin();
01407 for( ; it != ancestors.end(); ++it)
01408 {
01409 mmm += (*it)->dumpRoundRectangleRadius();
01410 }
01411
01412
01413 {
01414 const int radius = m_iAttrRoundRectangleRadius;
01415 CString p;
01416 p.Format("%ld", radius);
01417 if( radius != 9)
01418 mmm += indStr() + "<regnode name = \"roundCornerRadius\" value =\"" + (const char*)p + "\"></regnode>\n";
01419 }
01420 return mmm;
01421 }
01422