本文整理汇总了C++中ModelManager类的典型用法代码示例。如果您正苦于以下问题:C++ ModelManager类的具体用法?C++ ModelManager怎么用?C++ ModelManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModelManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMesh
//////////////////////////////////////////////////////////////////////////
//
// Class ModelManagerSlaver
//
void ModelManagerWrapper::AddMesh( const std::wstring& meshID, const std::wstring& meshFilename, const std::wstring& textureFilename )
{
ModelManager* pModelMan = MyIrrlichtEngine::GetEngine()->GetModelManager();
pModelMan->AddMesh( meshID, meshFilename, textureFilename );
}
示例2: sprintf
bool RobotBrainServiceService::start(int argc, char* argv[])
{
char adapterStr[255];
//Create the topics
SimEventsUtils::createTopic(communicator(), "SalientPointMessageTopic");
//Create the adapter
sprintf(adapterStr, "default -p %i", RobotBrainObjects::RobotBrainPort);
itsAdapter = communicator()->createObjectAdapterWithEndpoints("SaliencyModule",
adapterStr);
//Create the manager and its objects
itsMgr = new ModelManager("SaliencyModuleService");
LINFO("Starting SaliencyModule");
nub::ref<SaliencyModuleI> ret(new SaliencyModuleI(*itsMgr));
itsMgr->addSubComponent(ret);
ret->init(communicator(), itsAdapter);
itsMgr->parseCommandLine((const int)argc, (const char**)argv, "", 0, 0);
itsAdapter->activate();
itsMgr->start();
return true;
}
示例3: app
bool SeaBee3GUIService::start(int argc, char* argv[])
{
QApplication app(argc, argv);
itsMgr = new ModelManager("SeaBeeIIIGUIManager");
char adapterStr[255];
LINFO("Creating Adapter");
sprintf(adapterStr, "default -p %i", 12345);
itsAdapter = communicator()->createObjectAdapterWithEndpoints("RobotBrainPort",
adapterStr);
nub::ref<MainWindow> mainWindow(new MainWindow(*itsMgr));
itsMgr->addSubComponent(mainWindow);
LINFO("Starting Up GUI Comm");
mainWindow->initIce(communicator(), itsAdapter);
itsMgr->parseCommandLine(argc, argv, "", 0, 0);
itsAdapter->activate();
itsMgr->start();
mainWindow->setGeometry(100,100,900,800);
mainWindow->show();
return app.exec();
}
示例4: setup
void CompanyWidget::setup(int companyType, bool isFin, bool isContact,
bool isAdd, bool isLabel)
{
ui->finFrame->setHidden(!isFin);
ui->contactFrame->setHidden(!isContact);
ui->addCompany->setHidden(!isAdd);
ui->typeLabel->setHidden(!isLabel);
this->companyType = companyType;
ModelManager *models = ModelManager::getInstance();
if (isContact) {
contactF = new SortFilterModel(this);
contactF->setFilterRole(ContactModel::companyIdRole);
contactF->setSourceModel(models->getContactModel());
ui->contact->setModel(contactF);
}
SortFilterModel *companyF = new SortFilterModel(this);
companyF->setFilterRole(CompanyModel::typeRole);
companyF->setMatchValue(companyType);
companyF->setSourceModel(models->getCompanyModel());
ui->company->setModel(companyF);
if (companyType == Company::CUSTOMER) {
ui->typeLabel->setText(QString::fromUtf8("Заказчики"));
} else if (companyType == Company::SUPPLIER) {
ui->typeLabel->setText(QString::fromUtf8("Поставщики"));
} else if (companyType == -1) {
ui->typeLabel->setText(QString::fromUtf8("Компании"));
}
}
示例5: LDEBUG
bool RobotBrainServiceService::start(int argc, char* argv[])
#endif
{
MYLOGVERB = LOG_INFO;
char adapterStr[255];
//Create the adapter
int port = RobotBrainObjects::RobotBrainPort;
bool connected = false;
// try to connect to ports until successful
LDEBUG("Opening Connection");
while(!connected)
{
try
{
LINFO("Trying Port:%d", port);
sprintf(adapterStr, "default -p %i", port);
itsAdapter = communicator()->createObjectAdapterWithEndpoints
("GistSal_Navigation", adapterStr);
connected = true;
}
catch(Ice::SocketException)
{
port++;
}
}
//Create the manager and its objects
itsMgr = new ModelManager("BeoLocalizationService");
LINFO("Starting BeoLocalization System");
nub::ref<BeoLocalizer>
bl(new BeoLocalizer
(*itsMgr, "BeoLocalizer", "BeoLocalizer"));
LINFO("BeoLocalizer created");
itsMgr->addSubComponent(bl);
LINFO("BeoLocalizer Added As a subcomponent");
bl->init(communicator(), itsAdapter);
LINFO("BeoLocalizer initiated");
// check command line inputs/options
if (itsMgr->parseCommandLine((const int)argc, (const char**)argv,
"", 0, 0)
== false) return(1);
// FIXXX: in the future the map should be specificable
// from the command line to allow for stand alone application
// check app-Beobot2_GistSalLocalizer.C
// activate manager and adapter
itsAdapter->activate();
itsMgr->start();
return true;
}
示例6: while
bool RobotBrainServiceService::start(int argc, char* argv[])
{
char adapterStr[255];
//Create the adapter
int port = RobotBrainObjects::RobotBrainPort;
bool connected = false;
while(!connected)
{
try
{
LINFO("Trying Port:%d", port);
sprintf(adapterStr, "default -p %i", port);
itsAdapter = communicator()->createObjectAdapterWithEndpoints("SeaBee3SimulatorAdapter",
adapterStr);
connected = true;
}
catch(Ice::SocketException)
{
port++;
}
}
//Create the manager and its objects
itsMgr = new ModelManager("SeaBee3SimulatorServiceManager");
nub::ref<OutputFrameSeries> ofs(new OutputFrameSeries(*itsMgr));
itsMgr->addSubComponent(ofs);
LINFO("Starting SeaBee3 Simulator");
nub::ref<SeaBee3Simulator> subSim(new SeaBee3Simulator(*itsMgr, "SeaBee3Simulator", "SeaBee3Simulator"));
itsMgr->addSubComponent(subSim);
subSim->init(communicator(), itsAdapter);
itsMgr->parseCommandLine((const int)argc, (const char**)argv, "", 0, 0);
itsAdapter->activate();
itsMgr->start();
while(1){
Layout<PixRGB<byte> > outDisp;
subSim->simLoop();
Image<PixRGB<byte> > forwardCam = flipVertic(subSim->getFrame(1));
Image<PixRGB<byte> > downwardCam = flipVertic(subSim->getFrame(2));
outDisp = vcat(outDisp, hcat(forwardCam, downwardCam));
ofs->writeRgbLayout(outDisp, "subSim", FrameInfo("subSim", SRC_POS));
handle_keys(ofs, subSim);
}
return true;
}
示例7: LDEBUG
bool RobotBrainServiceService::start(int argc, char* argv[])
#endif
{
MYLOGVERB = LOG_INFO;
char adapterStr[255];
//Create the topics
// SimEventsUtils::createTopic(communicator(), "BeoGPSMessageTopic");
//Create the adapter
int port = RobotBrainObjects::RobotBrainPort;
bool connected = false;
// try to connect to ports until successful
LDEBUG("Opening Connection");
while(!connected)
{
try
{
LINFO("Trying Port:%d", port);
sprintf(adapterStr, "default -p %i", port);
itsAdapter = communicator()->createObjectAdapterWithEndpoints
("BeoGPS", adapterStr);
connected = true;
}
catch(Ice::SocketException)
{
port++;
}
}
//Create the manager and its objects
itsMgr = new ModelManager("BeoGPSService");
LINFO("Starting BeoGPS System");
nub::ref<BeoGPS> gps(new BeoGPS(*itsMgr, "BeoGPS", "BeoGPS"));
LINFO("BeoGPS created");
itsMgr->addSubComponent(gps);
LINFO("BeoGPS Added As a subcomponent");
gps->init(communicator(), itsAdapter);
LINFO("BeoGPS initiated");
// check command line inputs/options
if (itsMgr->parseCommandLine
(argc, argv, "<serdev>", 0, 0) == false)
return(1);
// let's configure our serial device:
// gps->configureSerial(itsMgr->getExtraArg(0));
// LINFO("Using: %s", itsMgr->getExtraArg(0).c_str());
// activate manager and adapter
itsAdapter->activate();
itsMgr->start();
return true;
}
示例8: QDialog
MsgDialog::MsgDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MsgDialog)
{
ui->setupUi(this);
ModelManager *models = ModelManager::getInstance();
ui->clients->setModel(models->getClientModel());
}
示例9: AddSceneNodeByMeshID
PythonSceneNode ModelManagerWrapper::AddSceneNodeByMeshID( const std::wstring& meshID, bool bTestCollision /*= false */ )
{
ModelManager* pModelMan = MyIrrlichtEngine::GetEngine()->GetModelManager();
PythonSceneNode node;
scene::ISceneNode* pNode = pModelMan->AddSceneNodeFromMesh( meshID, bTestCollision );
node.ptr = pNode;
//pNode->drop(); // 引用减一
return node;
}
示例10: main
int main(const int argc, const char **argv)
{
MYLOGVERB = LOG_INFO;
ModelManager *mgr = new ModelManager("Extract Patches for Hmax with Feature Learning");
mgr->exportOptions(MC_RECURSE);
// required arguments
// <c1patchesDir> <trainPosDir>
if (mgr->parseCommandLine(
(const int)argc, (const char**)argv, "<c1patchesDir> <trainPosDir>", 2, 2) == false)
return 1;
// Create a temp HmaxFL object to extract C1Patches
std::vector<int> c1ScaleSS(2);
c1ScaleSS[0] = 1; c1ScaleSS[1] = 3;
std::vector<int> c1SpaceSS(2);
c1SpaceSS[0] = 10; c1SpaceSS[1] = 11;
// desired frame sizes [11 and 13]
HmaxFL hmax(NORI,c1SpaceSS,c1ScaleSS,2,true,1.0F,1.0F,0.3F,4.05F,-0.05F,11,2);
std::string c1PatchesBaseDir;
std::string trainPosName; // Directory where positive images are
c1PatchesBaseDir = mgr->getExtraArg(0);
trainPosName = mgr->getExtraArg(1);
// Extract random patches from a set of images in a positive training directory
std::vector<std::string> trainPos = hmax.readDir(trainPosName);
int posTrainSize = trainPos.size();
//Image<byte> inputb;
Image<float> trainPosImage;
std::cout << "Scanned training and testing images" << std::endl;
std::vector<int> pS(4);
pS[0] = 4; pS[1] = 8, pS[2] = 12; pS[3] = 16;
std::srand(time(0));
for(int i=0;i<NUM_PATCHES_PER_SIZE;i++){
// Randomly select an image from the list
unsigned int imInd = static_cast<unsigned int>(floor((rand()-1.0F)/RAND_MAX*posTrainSize));
trainPosImage = Raster::ReadFloat(trainPos[imInd]);
// Learn the appropriate simple S2 patches from the C1 results
hmax.extractRandC1Patch(c1PatchesBaseDir,trainPosImage,i,pS);
}
std::cout << "Completed extraction of C1 Patches" << std::endl;
return 0;
}
示例11: on_ambientButton_clicked
void ToolWidget::on_ambientButton_clicked()
{
ModelManager* model = mainWindow->getModelManager();
if (!model->openLight()) {
QMessageBox::critical(this, "Error", "Fail to open new light");
}
mainWindow->getViewManager()->repaintAll();
ui->ambientButton->setEnabled(model->canOpenLight());
updateLightBox();
updateLightCanOpen();
}
示例12: if
void ToolWidget::on_tabWidget_currentChanged(QWidget *arg1)
{
if (arg1 == ui->solidTab) {
mainWindow->getModelManager()->selectSolid(selectedSolid);
mainWindow->getViewManager()->repaintAll();
} else if (arg1 == ui->primitiveTab) {
ModelManager* model = mainWindow->getModelManager();
ASolid* solid = model->getSolidFromPmt(selectedPrimitive);
model->selectSolid(solid);
mainWindow->getViewManager()->repaintAll();
}
}
示例13: LoadDataFromScene
void ModelPanel::LoadDataFromScene()
{
ModelManager* modelMgr = gEngine->GetModelManager();
std::list<Model*> modelList = modelMgr->GetModelList();
wxTreeItemId rootId = mTreeCtrl->AddRoot(L"root", 0, 0, New ModelTreeItemData(NULL));
for(std::list<Model*>::iterator iter = modelList.begin(); iter != modelList.end(); ++iter)
{
Model* model = *iter;
appendModel(rootId, model);
}
}
示例14: on_visiblePmtBtn_clicked
void ToolWidget::on_visiblePmtBtn_clicked()
{
ModelManager* model = mainWindow->getModelManager();
ASolid* solid = model->getSolidFromPmt(selectedPrimitive);
if (solid) {
solid->setVisible(!solid->getVisible());
mainWindow->getViewManager()->repaintAll();
if (ui->visiblePmtBtn->text() == "Hide") {
ui->visiblePmtBtn->setText("Show");
} else {
ui->visiblePmtBtn->setText("Hide");
}
}
}
示例15: LINFO
bool RobotBrainServiceService::start(int argc, char* argv[])
{
char adapterStr[255];
LINFO("Creating Topic!");
//Create the topics
// SimEventsUtils::createTopic(communicator(), "BinFinderMessageTopic");
//Create the adapter
int port = RobotBrainObjects::RobotBrainPort;
bool connected = false;
LDEBUG("Opening Connection");
while(!connected)
{
try
{
LINFO("Trying Port:%d", port);
sprintf(adapterStr, "default -p %i", port);
itsAdapter = communicator()->createObjectAdapterWithEndpoints
("BinFinder",
adapterStr);
connected = true;
}
catch(Ice::SocketException)
{
port++;
}
}
//Create the manager and its objects
itsMgr = new ModelManager("BinFinderService");
LINFO("Starting BinFinder");
nub::ref<BinFinder> ret
(new BinFinder(*itsMgr, "BinFinder1", "BinFinder2"));
LINFO("BinFinder Created");
itsMgr->addSubComponent(ret);
LINFO("BinFinder Added As Sub Component");
ret->init(communicator(), itsAdapter);
LINFO("BinFinder Inited");
itsMgr->parseCommandLine((const int)argc, (const char**)argv, "", 0, 0);
itsAdapter->activate();
itsMgr->start();
return true;
}