comparison Samples/Sdl/Loader.cpp @ 804:61ba4b504e9a

PolylineSceneLayer now has one color per chain
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 15:58:21 +0200
parents f38c1fc08655
children 6a75f1c03c4e
comparison
equal deleted inserted replaced
802:f38c1fc08655 804:61ba4b504e9a
1792 command->SetUri("/tools/lookup"); 1792 command->SetUri("/tools/lookup");
1793 command->SetMethod(Orthanc::HttpMethod_Post); 1793 command->SetMethod(Orthanc::HttpMethod_Post);
1794 command->SetBody(*it); 1794 command->SetBody(*it);
1795 command->SetPayload(new LookupInstance(loader, *it)); 1795 command->SetPayload(new LookupInstance(loader, *it));
1796 Schedule(command.release()); 1796 Schedule(command.release());
1797
1798 printf("[%s]\n", it->c_str());
1799 } 1797 }
1800 } 1798 }
1801 }; 1799 };
1802 1800
1803 1801
1850 std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); 1848 std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer);
1851 layer->SetThickness(2); 1849 layer->SetThickness(2);
1852 1850
1853 for (size_t i = 0; i < content_.GetStructuresCount(); i++) 1851 for (size_t i = 0; i < content_.GetStructuresCount(); i++)
1854 { 1852 {
1853 const Color& color = content_.GetStructureColor(i);
1854
1855 std::vector< std::vector<DicomStructureSet::PolygonPoint> > polygons; 1855 std::vector< std::vector<DicomStructureSet::PolygonPoint> > polygons;
1856 1856
1857 if (content_.ProjectStructure(polygons, i, cuttingPlane)) 1857 if (content_.ProjectStructure(polygons, i, cuttingPlane))
1858 { 1858 {
1859 printf(">> %d\n", static_cast<int>(polygons.size()));
1860
1861 for (size_t j = 0; j < polygons.size(); j++) 1859 for (size_t j = 0; j < polygons.size(); j++)
1862 { 1860 {
1863 PolylineSceneLayer::Chain chain; 1861 PolylineSceneLayer::Chain chain;
1864 chain.resize(polygons[j].size()); 1862 chain.resize(polygons[j].size());
1865 1863
1866 for (size_t k = 0; k < polygons[j].size(); k++) 1864 for (size_t k = 0; k < polygons[j].size(); k++)
1867 { 1865 {
1868 chain[k] = ScenePoint2D(polygons[j][k].first, polygons[j][k].second); 1866 chain[k] = ScenePoint2D(polygons[j][k].first, polygons[j][k].second);
1869 } 1867 }
1870 1868
1871 layer->AddChain(chain, true /* closed */); 1869 layer->AddChain(chain, true /* closed */, color);
1872 } 1870 }
1873 } 1871 }
1874 } 1872 }
1875 1873
1876 return layer.release(); 1874 return layer.release();
2490 int main(int argc, char* argv[]) 2488 int main(int argc, char* argv[])
2491 { 2489 {
2492 OrthancStone::StoneInitialize(); 2490 OrthancStone::StoneInitialize();
2493 //Orthanc::Logging::EnableInfoLevel(true); 2491 //Orthanc::Logging::EnableInfoLevel(true);
2494 2492
2493 printf("%d\n", __cplusplus);
2494
2495 try 2495 try
2496 { 2496 {
2497 OrthancStone::NativeApplicationContext context; 2497 OrthancStone::NativeApplicationContext context;
2498 2498
2499 OrthancStone::ThreadedOracle oracle(context); 2499 OrthancStone::ThreadedOracle oracle(context);