comparison Samples/Sdl/Loader.cpp @ 1298:8a0a62189f46

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 16:31:30 +0100
parents 2d8ab34c8c91
children
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
118 { 118 {
119 private: 119 private:
120 OrthancStone::CoordinateSystem3D plane_; 120 OrthancStone::CoordinateSystem3D plane_;
121 OrthancStone::IOracle& oracle_; 121 OrthancStone::IOracle& oracle_;
122 OrthancStone::Scene2D scene_; 122 OrthancStone::Scene2D scene_;
123 std::auto_ptr<OrthancStone::VolumeSceneLayerSource> source1_, source2_, source3_; 123 std::unique_ptr<OrthancStone::VolumeSceneLayerSource> source1_, source2_, source3_;
124 124
125 125
126 void Refresh() 126 void Refresh()
127 { 127 {
128 if (source1_.get() != NULL) 128 if (source1_.get() != NULL)
340 } 340 }
341 #endif 341 #endif
342 342
343 343
344 { 344 {
345 std::auto_ptr<OrthancStone::LookupTableStyleConfigurator> config(new OrthancStone::LookupTableStyleConfigurator); 345 std::unique_ptr<OrthancStone::LookupTableStyleConfigurator> config(new OrthancStone::LookupTableStyleConfigurator);
346 config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT); 346 config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT);
347 347
348 boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> tmp(new OrthancStone::DicomVolumeImageMPRSlicer(dose)); 348 boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> tmp(new OrthancStone::DicomVolumeImageMPRSlicer(dose));
349 toto->SetVolume2(1, tmp, config.release()); 349 toto->SetVolume2(1, tmp, config.release());
350 } 350 }
357 { 357 {
358 Json::Value v = Json::objectValue; 358 Json::Value v = Json::objectValue;
359 v["Level"] = "Series"; 359 v["Level"] = "Series";
360 v["Query"] = Json::objectValue; 360 v["Query"] = Json::objectValue;
361 361
362 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); 362 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand);
363 command->SetMethod(Orthanc::HttpMethod_Post); 363 command->SetMethod(Orthanc::HttpMethod_Post);
364 command->SetUri("/tools/find"); 364 command->SetUri("/tools/find");
365 command->SetBody(v); 365 command->SetBody(v);
366 366
367 oracle.Schedule(*toto, command.release()); 367 oracle.Schedule(*toto, command.release());
369 369
370 if(0) 370 if(0)
371 { 371 {
372 if (0) 372 if (0)
373 { 373 {
374 std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); 374 std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand);
375 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg))); 375 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg)));
376 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); 376 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
377 oracle.Schedule(*toto, command.release()); 377 oracle.Schedule(*toto, command.release());
378 } 378 }
379 379
380 if (0) 380 if (0)
381 { 381 {
382 std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); 382 std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand);
383 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); 383 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
384 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); 384 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
385 oracle.Schedule(*toto, command.release()); 385 oracle.Schedule(*toto, command.release());
386 } 386 }
387 387
388 if (0) 388 if (0)
389 { 389 {
390 std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); 390 std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand);
391 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); 391 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
392 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); 392 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
393 oracle.Schedule(*toto, command.release()); 393 oracle.Schedule(*toto, command.release());
394 } 394 }
395 395
396 if (0) 396 if (0)
397 { 397 {
398 std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); 398 std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand);
399 command->SetHttpHeader("Accept-Encoding", "gzip"); 399 command->SetHttpHeader("Accept-Encoding", "gzip");
400 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); 400 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
401 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); 401 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
402 oracle.Schedule(*toto, command.release()); 402 oracle.Schedule(*toto, command.release());
403 } 403 }
404 404
405 if (0) 405 if (0)
406 { 406 {
407 std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); 407 std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand);
408 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); 408 command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
409 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); 409 command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
410 oracle.Schedule(*toto, command.release()); 410 oracle.Schedule(*toto, command.release());
411 } 411 }
412 412
413 if (0) 413 if (0)
414 { 414 {
415 std::auto_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> command(new OrthancStone::GetOrthancWebViewerJpegCommand); 415 std::unique_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> command(new OrthancStone::GetOrthancWebViewerJpegCommand);
416 command->SetHttpHeader("Accept-Encoding", "gzip"); 416 command->SetHttpHeader("Accept-Encoding", "gzip");
417 command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e"); 417 command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e");
418 command->SetQuality(90); 418 command->SetQuality(90);
419 oracle.Schedule(*toto, command.release()); 419 oracle.Schedule(*toto, command.release());
420 } 420 }
422 422
423 if (0) 423 if (0)
424 { 424 {
425 for (unsigned int i = 0; i < 10; i++) 425 for (unsigned int i = 0; i < 10; i++)
426 { 426 {
427 std::auto_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000)); 427 std::unique_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000));
428 command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(42 * i)); 428 command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(42 * i));
429 oracle.Schedule(*toto, command.release()); 429 oracle.Schedule(*toto, command.release());
430 } 430 }
431 } 431 }
432 } 432 }