[mapguide-commits] r7401 - in sandbox/adsk/2.3r.sce/Server/src/Services: Mapping Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Mar 19 18:55:18 PDT 2013
Author: hubu
Date: 2013-03-19 18:55:18 -0700 (Tue, 19 Mar 2013)
New Revision: 7401
Modified:
sandbox/adsk/2.3r.sce/Server/src/Services/Mapping/MappingUtil.cpp
sandbox/adsk/2.3r.sce/Server/src/Services/Rendering/ServerRenderingService.cpp
Log:
Submit on behalf of Andy Zhang.
This submission is for SCE project.
Fix the issue that Label cannot display correctly.
Modified: sandbox/adsk/2.3r.sce/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- sandbox/adsk/2.3r.sce/Server/src/Services/Mapping/MappingUtil.cpp 2013-03-18 10:46:14 UTC (rev 7400)
+++ sandbox/adsk/2.3r.sce/Server/src/Services/Mapping/MappingUtil.cpp 2013-03-20 01:55:18 UTC (rev 7401)
@@ -590,7 +590,7 @@
// iterate through the rulecollection
RuleCollection* ruleColl = pfts->GetRules();
int rccount = ruleColl->GetCount();
- for (int k=0; k<rccount; ++k)
+ for (int k=0; k < rccount && !hasRuleFilter; ++k)
{
Rule* rule = ruleColl->GetAt(k);
if (!rule->GetFilter().empty())
@@ -598,6 +598,42 @@
hasRuleFilter = true;
break;
}
+ Label* label = rule->GetLabel();
+ if (label)
+ {
+ MdfModel::TextSymbol* textSymbol = label->GetSymbol();
+ if (textSymbol)
+ {
+ hasRuleFilter = true;
+ break;
+ }
+ }
+ //AreaRule* paRule = dynamic_cast<AreaRule*>(rule);
+ //LineRule* plRule = dynamic_cast<LineRule*>(rule);
+ //PointRule* ppRule = dynamic_cast<PointRule*>(rule);
+ CompositeRule* pcRule = dynamic_cast<CompositeRule*>(rule);
+ if (pcRule)
+ {
+ CompositeSymbolization* cSym = pcRule->GetSymbolization();
+ SymbolInstanceCollection* sIs = cSym->GetSymbolCollection();
+ for (int l = 0; l <sIs->GetCount() && !hasRuleFilter; l++)
+ {
+ SymbolInstance* si = sIs->GetAt(l);
+ SymbolDefinition* sd = si->GetSymbolDefinition();
+ SimpleSymbolDefinition* ssd = dynamic_cast<SimpleSymbolDefinition*>(sd);
+ GraphicElementCollection* graphics = ssd->GetGraphics();
+ for (int m = 0; m <graphics->GetCount(); m++)
+ {
+ GraphicElement* ge = graphics->GetAt(m);
+ Text* text = dynamic_cast<Text*>(ge);
+ if (text)
+ {
+ hasRuleFilter = true;
+ break;
+ }
+ }
+ }
+ }
}
}
Modified: sandbox/adsk/2.3r.sce/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- sandbox/adsk/2.3r.sce/Server/src/Services/Rendering/ServerRenderingService.cpp 2013-03-18 10:46:14 UTC (rev 7400)
+++ sandbox/adsk/2.3r.sce/Server/src/Services/Rendering/ServerRenderingService.cpp 2013-03-20 01:55:18 UTC (rev 7401)
@@ -1568,7 +1568,7 @@
// iterate through the rulecollection
RuleCollection* ruleColl = pfts->GetRules();
int rccount = ruleColl->GetCount();
- for (int k=0; k<rccount; ++k)
+ for (int k=0; k < rccount && !hasRuleFilter; ++k)
{
Rule* rule = ruleColl->GetAt(k);
if (!rule->GetFilter().empty())
@@ -1576,6 +1576,39 @@
hasRuleFilter = true;
break;
}
+ Label* label = rule->GetLabel();
+ if (label)
+ {
+ MdfModel::TextSymbol* textSymbol = label->GetSymbol();
+ if (textSymbol)
+ {
+ hasRuleFilter = true;
+ break;
+ }
+ }
+ CompositeRule* pcRule = dynamic_cast<CompositeRule*>(rule);
+ if (pcRule)
+ {
+ CompositeSymbolization* cSym = pcRule->GetSymbolization();
+ SymbolInstanceCollection* sIs = cSym->GetSymbolCollection();
+ for (int l = 0; l < sIs->GetCount() && !hasRuleFilter; l++)
+ {
+ SymbolInstance* si = sIs->GetAt(l);
+ SymbolDefinition* sd = si->GetSymbolDefinition();
+ SimpleSymbolDefinition* ssd = dynamic_cast<SimpleSymbolDefinition*>(sd);
+ GraphicElementCollection* graphics = ssd->GetGraphics();
+ for (int m = 0; m <graphics->GetCount(); m++)
+ {
+ GraphicElement* ge = graphics->GetAt(m);
+ Text* text = dynamic_cast<Text*>(ge);
+ if (text)
+ {
+ hasRuleFilter = true;
+ break;
+ }
+ }
+ }
+ }
}
}
if (!hasRuleFilter)
@@ -1589,6 +1622,10 @@
Ptr<MgPropertyDefinition> prop = props->GetItem(i);
options->AddFeatureProperty(prop->GetName());
}
+ if (geometry != NULL)
+ {
+ options->AddFeatureProperty(layer->GetFeatureGeometryName());
+ }
}
}
More information about the mapguide-commits
mailing list