本文整理汇总了C++中GetSystem函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSystem函数的具体用法?C++ GetSystem怎么用?C++ GetSystem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSystem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void ChMatterSPH::AddCollisionModelsToSystem() {
assert(GetSystem());
SyncCollisionModels();
for (unsigned int j = 0; j < nodes.size(); j++) {
GetSystem()->GetCollisionSystem()->Add(nodes[j]->collision_model);
}
}
示例2: switch
void Window::HandleInput(SDL_Event& event, float dt)
{
switch( event.type )
{
case SDL_MOUSEMOTION:
{
if( Input::GetInstance()->GetMouseButton(SDL_BUTTON_RIGHT) )
GetSystem(Graphics)->UpdateCameraRotation((float)event.motion.xrel*0.3f, (float)event.motion.yrel*0.3f);
else if( Input::GetInstance()->GetMouseButton(SDL_BUTTON_LEFT) )
GetSystem(Graphics)->UpdateLightPos((float)event.motion.xrel*0.3f, (float)event.motion.yrel*0.3f);
}
break;
case SDL_MOUSEBUTTONDOWN:
Input::GetInstance()->MouseButtonEvent(event.button.button, true, event.button.x, event.button.y);
break;
case SDL_MOUSEBUTTONUP:
Input::GetInstance()->MouseButtonEvent(event.button.button, false, event.button.x, event.button.y);
break;
case SDL_KEYDOWN:
Input::GetInstance()->KeyboardEvent(event.key.keysym.sym, true);
break;
case SDL_KEYUP:
Input::GetInstance()->KeyboardEvent(event.key.keysym.sym, false);
break;
default:
break;
}
}
示例3: sizeof
void CBeam::OnWriteToStream (IWriteStream *pStream)
// OnWriteToStream
//
// Write the object's data to stream
//
// CString CWeaponFireDesc UNID
// DWORD m_iBonus
// DWORD m_iCause
// DWORD m_iRotation
// Vector m_vPaintTo
// DWORD m_iTick
// DWORD m_iLifeLeft
// DWORD m_Source (CSpaceObject Ref)
// DWORD m_pSovereign (UNID)
// DWORD m_pHit (CSpaceObject Ref)
// DWORD m_iHitDir
{
DWORD dwSave;
m_pDesc->m_sUNID.WriteToStream(pStream);
pStream->Write((char *)&m_iBonus, sizeof(DWORD));
dwSave = m_iCause;
pStream->Write((char *)&dwSave, sizeof(DWORD));
pStream->Write((char *)&m_iRotation, sizeof(DWORD));
pStream->Write((char *)&m_vPaintTo, sizeof(m_vPaintTo));
pStream->Write((char *)&m_iTick, sizeof(DWORD));
pStream->Write((char *)&m_iLifeLeft, sizeof(m_iLifeLeft));
m_Source.WriteToStream(GetSystem(), pStream);
GetSystem()->WriteSovereignRefToStream(m_pSovereign, pStream);
WriteObjRefToStream(m_pHit, pStream);
pStream->Write((char *)&m_iHitDir, sizeof(DWORD));
}
示例4: StarlaneEntranceOrbitalPosition
double StarlaneEntranceOrbitalPosition(int from_system, int to_system) {
TemporaryPtr<const System> system_1 = GetSystem(from_system);
TemporaryPtr<const System> system_2 = GetSystem(to_system);
if (!system_1 || !system_2) {
Logger().errorStream() << "StarlaneEntranceOrbitalPosition passed invalid system id";
return 0.0;
}
return std::atan2(system_2->Y() - system_1->Y(), system_2->X() - system_1->X());
}
示例5: sTemp
//--------------------------------------------------------------------------------
void CSystemMonitorHandlerThread::DoLoad(LPCTSTR pFilename)
{
CString sTemp(pFilename);
if(! sTemp.IsEmpty())
GetSystem()->SetLicenseFilename(sTemp);
if(GetSystem()->GetDBSubSystem()->LoadFromFile())
sTemp = "file loaded ok\r\n";
else
sTemp = "error while loading file\r\n";
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
}
示例6: GetSystem
void Moderator::AddStarlane::Execute() const {
TemporaryPtr<System> sys1 = GetSystem(m_id_1);
if (!sys1) {
Logger().errorStream() << "Moderator::AddStarlane::Execute couldn't get system with id: " << m_id_1;
return;
}
TemporaryPtr<System> sys2 = GetSystem(m_id_2);
if (!sys2) {
Logger().errorStream() << "Moderator::AddStarlane::Execute couldn't get system with id: " << m_id_2;
return;
}
sys1->AddStarlane(m_id_2);
sys2->AddStarlane(m_id_1);
}
示例7: DoListAll
//--------------------------------------------------------------------------------
void CSystemMonitorHandlerThread::DoList()
{
if(m_sCurCmd.Find("all") != -1)
{
DoListAll();
return;
}
CDBTokenInfoMap* pDB = GetSystem()->GetDBSubSystem()->GetTokenInfoMap();
CString sTemp;
CReadLock lock(pDB, false);
if(! lock.Lock(5000))
{
sTemp = "can't lock the database right now (probably a lot of activity)\r\n";
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
return;
}
sTemp = " Id Name In Use Count Max\r\n";
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
for(POSITION pos = pDB->GetStartPosition(); pos != NULL; )
{
DWORD nId;
CDBTokenInfo* pInfo;
pDB->GetNextAssoc(pos, nId, pInfo);
if(! pInfo)
continue;
sTemp.Format("%4d %12s %6d %6d %6d\r\n",
nId, pInfo->m_token.GetName(), pInfo->m_nInUse, pInfo->m_nCount, pInfo->m_nMax);
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
}
if(GetSystem()->IsBackupServer())
sTemp.Format("%s%s\r\n", "Running as backup server", GetSystem()->IsServing() ? " currently serving" : "");
else
sTemp.Format("Backup SecurityServer is %s\r\n", GetSystem()->IsBackupRunning() ? "running" : "not running");
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
#ifdef _DEBUG
#pragma message("Don't forget to change the listed version for the next release!")
#endif
sTemp.Format("This server is version " SECSERV_VERSION_STRING "\r\n");
m_socket.Send(sTemp, sTemp.GetLength(), CSmallSocket::WAITFORWOULDBLOCK);
}
示例8: Order
FleetMoveOrder::FleetMoveOrder(int empire, int fleet_id, int start_system_id, int dest_system_id, bool append) :
Order(empire),
m_fleet(fleet_id),
m_start_system(start_system_id),
m_dest_system(dest_system_id),
m_append(append)
{
// perform sanity checks
TemporaryPtr<const Fleet> fleet = GetFleet(FleetID());
if (!fleet) {
ErrorLogger() << "Empire with id " << EmpireID() << " ordered fleet with id " << FleetID() << " to move, but no such fleet exists";
return;
}
TemporaryPtr<const System> destination_system = GetSystem(DestinationSystemID());
if (!destination_system) {
ErrorLogger() << "Empire with id " << EmpireID() << " ordered fleet to move to system with id " << DestinationSystemID() << " but no such system exists / is known to exist";
return;
}
// verify that empire specified in order owns specified fleet
if (!fleet->OwnedBy(EmpireID()) ) {
ErrorLogger() << "Empire with id " << EmpireID() << " order to move but does not own fleet with id " << FleetID();
return;
}
std::pair<std::list<int>, double> short_path = GetUniverse().ShortestPath(m_start_system, m_dest_system, empire);
m_route.clear();
std::copy(short_path.first.begin(), short_path.first.end(), std::back_inserter(m_route));
// ensure a zero-length (invalid) route is not requested / sent to a fleet
if (m_route.empty())
m_route.push_back(m_start_system);
}
示例9: TEST_F
TEST_F(TestDoubleClearIndoorShadeAir, Test1)
{
SCOPED_TRACE("Begin Test: Indoor Shade - Air");
auto aSystem = GetSystem();
auto temperature = aSystem->getTemperatures();
auto radiosity = aSystem->getRadiosities();
std::vector<double> correctTemp = {
258.2265788, 258.7403799, 276.1996405, 276.7134416, 288.1162677, 288.1193825};
std::vector<double> correctJ = {
250.2066021, 264.5687123, 319.49179, 340.4531177, 382.6512706, 397.0346045};
EXPECT_EQ(correctTemp.size(), temperature.size());
EXPECT_EQ(correctJ.size(), radiosity.size());
for(size_t i = 0; i < temperature.size(); ++i)
{
EXPECT_NEAR(correctTemp[i], temperature[i], 1e-6);
EXPECT_NEAR(correctJ[i], radiosity[i], 1e-6);
}
const auto numOfIter = aSystem->getNumberOfIterations();
EXPECT_EQ(1, int(numOfIter));
const auto ventilatedFlow = aSystem->getVentilationFlow(Tarcog::ISO15099::Environment::Indoor);
EXPECT_NEAR(40.066868, ventilatedFlow, 1e-6);
}
示例10: OnInit
bool HypoApp::OnInit()
{
int x = 700;
int y = 920; // 1100 // 850
wxPoint pos;
if(GetSystem() == Mac) {
x = 685;
pos.x = 50;
pos.y = 23; // 0;
}
else pos = wxDefaultPosition;
OptionLoad();
if(viewwidth < 400) viewwidth = 400;
y = viewheight;
x = viewwidth;
wxSize screensize = wxGetDisplaySize();
if(x > screensize.GetX()) x = screensize.GetX() - 50;
if(y > screensize.GetY()) y = screensize.GetY() - 50;
//MainFrame *mainwin = new MainFrame("Hypo Net Model", wxPoint(50, 10), wxSize(700, y)); // 850 // 920
HypoMain *mainwin = new HypoMain("HypoMod", pos, wxSize(x, y)); // 850 // 920
//HypoMain *mainwin = new HypoMain("HypoMod", wxDefaultPosition, wxSize(400, 500));
mainwin->Show(TRUE);
SetTopWindow(mainwin);
return TRUE;
}
示例11: wxFrame
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
ostype = GetSystem();
mainwin = this;
statusbar = CreateStatusBar();
diagbox = NULL; // Protect diagbox self reference for toolpanel
gridbox = NULL;
neurobox = NULL;
diagbox = new DiagBox(this, "Diagnostic", wxPoint(0, 0), wxSize(400, 500));
diagbox->Write("Diagnostic Box OK\n\n");
graphbox = NULL;
plotbox = NULL;
colourpen[0].Set("#000000"); // 0 black
colourpen[1].Set("#F50000"); // 1 red
colourpen[2].Set("#00F500"); // 2 green
colourpen[3].Set("#0000F5"); // 3 blue
colourpen[4].Set("#F5F500"); // 4 yellow
colourpen[5].Set("#F500F5"); // 5 purple
colourpen[6].Set("#FF8080"); // 6 light red
colourpen[7].Set("#80FF80"); // 7 light green
colourpen[8].Set("#8080FF"); // 8 light blue
colourpen[9].Set("#000000"); // 9 custom
toolset = new ToolSet();
toolset->AddBox(diagbox, true);
}
示例12: Logger
void Fleet::AddShip(int ship_id) {
if (this->Contains(ship_id)) {
Logger().debugStream() << "Fleet::AddShip this fleet '" << this->Name() << "' already contained ship '" << ship_id << "'";
return;
}
Ship* ship = GetShip(ship_id);
if (!ship) {
Logger().errorStream() << "Fleet::AddShips() : Attempted to add an id (" << ship_id << ") of a non-ship object to a fleet.";
return;
}
//Logger().debugStream() << "Fleet '" << this->Name() << "' adding ship: " << ship_id;
// remove ship from old fleet
if (Fleet* old_fleet = GetFleet(ship->FleetID()))
old_fleet->RemoveShip(ship_id);
// ensure ship is in same system as this fleet
int ship_system_id = ship->SystemID();
int this_fleet_system_id = this->SystemID();
if (ship_system_id != this_fleet_system_id)
if (System* system = GetSystem(this_fleet_system_id))
system->Insert(ship); // sets ship's system, remove from old system (if any) and moves ship to system's location (if necessary)
// add ship to this fleet, and set its internal fleet record
ship->SetFleetID(ID());
m_ships.insert(ship_id);
RecalculateFleetSpeed();
StateChangedSignal();
}
示例13: while
void Window::Update(float dt)
{
//Event polling
while (SDL_PollEvent(&e))
{
switch( e.type )
{
//If user closes the window
case SDL_QUIT:
Core::GetInstance()->SetState(-1);
break;
case SDL_WINDOWEVENT:
{
if( e.window.event == SDL_WINDOWEVENT_RESIZED )
{
WINDOW_W = e.window.data1;
WINDOW_H = e.window.data2;
GetSystem(Graphics)->UpdateScreenDims(WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H);
break;
}
}
default:
HandleInput(e, dt);
break;
};
}
//SDL_RenderClear(renderer);
//SDL_RenderPresent(renderer);
}
示例14: TEST_F
TEST_F(TestDoubleClearSingleSystemNoSun, Test1)
{
SCOPED_TRACE("Begin Test: Double Clear Single System - Surface temperatures");
auto aSystem = GetSystem();
ASSERT_TRUE(aSystem != nullptr);
auto Temperature = aSystem->getTemperatures();
std::vector<double> correctTemperature = {258.756688, 259.359226, 279.178510, 279.781048};
ASSERT_EQ(correctTemperature.size(), Temperature.size());
for(auto i = 0u; i < correctTemperature.size(); ++i)
{
EXPECT_NEAR(correctTemperature[i], Temperature[i], 1e-5);
}
auto Radiosity = aSystem->getRadiosities();
std::vector<double> correctRadiosity = {251.950834, 268.667346, 332.299338, 359.731700};
ASSERT_EQ(correctRadiosity.size(), Radiosity.size());
for(auto i = 0u; i < correctRadiosity.size(); ++i)
{
EXPECT_NEAR(correctRadiosity[i], Radiosity[i], 1e-5);
}
auto heatFlow = aSystem->getHeatFlow(Tarcog::ISO15099::Environment::Indoor);
EXPECT_NEAR(105.431019, heatFlow, 1e-5);
auto Uvalue = aSystem->getUValue();
EXPECT_NEAR(2.703359, Uvalue, 1e-5);
auto numOfIter = aSystem->getNumberOfIterations();
EXPECT_EQ(20u, numOfIter);
}
示例15: GetSystem
ParamText::ParamText(wxPanel *panel, wxString pname, wxString labelname, wxString initval, int labelwid, int textwid)
{
wxControl::Create(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
name = pname;
labelwidth = labelwid;
textwidth = textwid;
buttonwidth = 0;
ostype = GetSystem();
textfont = wxFont(wxFontInfo(8).FaceName("Tahoma"));
//textfont = wxFont(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, "Tahoma");
if(ostype == Mac) textfont = wxFont(wxFontInfo(11).FaceName("Tahoma"));
confont = textfont;
sizer = new wxBoxSizer(wxHORIZONTAL);
label = new wxStaticText(this, wxID_STATIC, labelname, wxDefaultPosition, wxSize(labelwidth, -1), wxALIGN_CENTRE);
textbox = new wxTextCtrl(this, wxID_ANY, initval, wxDefaultPosition, wxSize(textwidth, -1), wxTE_PROCESS_ENTER);
label->SetFont(textfont);
textbox->SetFont(textfont);
SetInitialSize(wxDefaultSize);
Move(wxDefaultPosition);
sizer->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
sizer->Add(textbox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2);
SetSizer(sizer);
Layout();
}