コード例 #1
0
void MainWindow::mask()
{
    std::unique_ptr< MaskingDialog > dlg( new MaskingDialog( server, this ) );
    if( dlg->exec() == QDialog::Accepted )
    {
        CARNA_ASSERT( dlg->hasMask() );

        std::unique_ptr< Carna::base::model::SceneFactory > modelFactory( new Carna::base::model::SceneFactory( this ) );
        Carna::base::model::Scene* const newModel = modelFactory->createFromVolumeMasking( carna->model(), dlg->getMask() );

        modelFactory.reset();
        dlg.reset();
        this->closeRecord();
        this->init( newModel );
    }
}
コード例 #2
0
ファイル: Otw.cpp プロジェクト: doughodson/OpenEaagles
//------------------------------------------------------------------------------
// newModelEntry() -- Generates a new model entry for this player.
//                    Returns a pointer to the new entry, else zero(0)
//------------------------------------------------------------------------------
OtwModel* Otw::newModelEntry(models::Player* const ip)
{
   OtwModel* model = nullptr;

   // Only if we have a player pointer ...
   if (ip != nullptr && (getModelTableSize() < getMaxModels())) {

      // Create a model entry for this player
      model = modelFactory();
      if (model != nullptr) {
         // Yes, initialize the model entry
         model->initialize(ip, otwModelTypes.data(), nOtwModelTypes);
         addModelToList(model, MODEL_TABLE);
      }
   }
   return model;
}