本文整理汇总了C++中IsInside函数的典型用法代码示例。如果您正苦于以下问题:C++ IsInside函数的具体用法?C++ IsInside怎么用?C++ IsInside使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsInside函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: assert
void
Thread::Join()
{
assert(IsDefined());
assert(!IsInside());
#ifdef HAVE_POSIX
pthread_join(handle, nullptr);
defined = false;
#else
::WaitForSingleObject(handle, INFINITE);
::CloseHandle(handle);
handle = nullptr;
#endif
#ifndef NDEBUG
all_threads_mutex.lock();
all_threads.erase(all_threads.iterator_to(*this));
all_threads_mutex.unlock();
#endif
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:21,代码来源:Thread.cpp
示例2: Process
unsigned CClanMemberItem::Process( unsigned uiMsg, WPARAM wParam, LPARAM lParam )
{
if( !IsInside( LOWORD(lParam), HIWORD( lParam )) ) return 0;
switch( uiMsg )
{
case WM_LBUTTONDOWN:
{
CTDialog* pDlg = g_itMGR.FindDlg( DLG_TYPE_CLAN );
if( pDlg )
{
CClanDlg* pClanDlg = (CClanDlg*)pDlg;
pClanDlg->SetSelectedMember( m_iClanPoint );
}
SetSelected();
}
return GetControlID();
default:
break;
}
return 0;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:21,代码来源:ClanMemberItem.cpp
示例3: Input
void UIBase::Input(){
int key = InputManager::GetInstance().GetMouseMousePressKey();
Point mpos = InputManager::GetInstance().GetMouse();
if (IsInside(mpos.x,mpos.y)){
if (key != 0 && OnMousePress){
OnMousePress(this,key,mpos);
}
key = InputManager::GetInstance().GetMouseMouseReleaseKey();
if (key != 0 && OnMouseRelease){
OnMouseRelease(this,key,mpos);
}
if (!MouseInside){
if (OnMouseEnter){
OnMouseEnter(this,mpos);
}
MouseInside = true;
}
}else{
if (MouseInside){
if (OnMouseLeave){
OnMouseLeave(this,mpos);
}
MouseInside = false;
}
}
key = InputManager::GetInstance().IsAnyKeyPressed();
if (key != -1 && OnKeyPress){
OnKeyPress(this,key);
}
/*for (unsigned i = 0; i < Components.size(); ++i) {
if (!Components[i]->IsDead()){
Components[i]->Input();
}
}*/
}
开发者ID:mockthebear,项目名称:bear-engine,代码行数:40,代码来源:base.cpp
示例4: Close
WMSG_RESULT CUIPortal::OnLButtonDown( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
{
Close();
return WMSG_FAIL;
}
if( m_pmoveArea && m_pmoveArea->IsInside(x, y))
{
m_bDrag = true;
m_nOriX = x;
m_nOriY = y;
}
CUIManager::getSingleton()->RearrangeOrder( UI_PORTAL, TRUE );
return WMSG_FAIL;
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:22,代码来源:UIPortalNew.cpp
示例5: Remove
void
IOThread::LockRemove(int fd)
{
mutex.Lock();
const bool old_modified = modified;
Remove(fd);
const bool new_modified = modified;
if (new_modified && running && !IsInside()) {
/* this method is synchronous: after returning, all handlers must
be finished */
do {
cond.Wait(mutex);
} while (running);
}
mutex.Unlock();
if (!old_modified && new_modified)
pipe.Signal();
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:22,代码来源:IOThread.cpp
示例6: OnLButtonDBLClick
WMSG_RESULT CUITrade::OnLButtonDBLClick( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
if (m_pList[eLIST_AMEND_ITEM]->IsInside(x, y) == TRUE)
{
if (m_pList[eLIST_AMEND_ITEM]->HitTest(x, y) < 0)
{
UpdateAmendItem(-1);
UpdateAmendCondition(-1);
if (m_pBtnOk != NULL)
m_pBtnOk->SetEnable(FALSE);
}
}
return WMSG_SUCCESS;
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:22,代码来源:UITrade.cpp
示例7: OnLButtonDown
WMSG_RESULT CUIQuestBook::OnLButtonDown( UINT16 x, UINT16 y )
{
if (m_bHide)
return WMSG_FAIL;
if (m_bLockQuestList == TRUE)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
if( m_pmoveArea && m_pmoveArea->IsInside(x, y))
{
m_bDrag = true;
m_nOriX = x;
m_nOriY = y;
}
CUIManager::getSingleton()->RearrangeOrder( UI_QUESTBOOK_LIST, TRUE );
return WMSG_FAIL;
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:22,代码来源:UIQuestBookNew.cpp
示例8: IsSphereInside
bool Frustum::IsVisible(const Node& node, Mesh& mesh) const
{
if (mesh.IsReady())
{
Vertex3 center = node.GetGlobalPosition();
float radius = mesh.GetBoundingSphereRadius();
Vector3 scale = node.GetGlobalScale();
float maxScale = std::max(std::max(scale.x, scale.y), scale.z);
radius *= maxScale;
Intersection sphereFrustumIntersec = IsSphereInside(center, radius);
if (sphereFrustumIntersec == Intersection::INTERSECTS)
{
BoundingBox bb = mesh.GetBB();
bb.Transform(node);
return IsInside(bb) != Intersection::OUTSIDE;
}
else
return sphereFrustumIntersec != Intersection::OUTSIDE;
}
return false;
}
开发者ID:dreamsxin,项目名称:nsg-library,代码行数:22,代码来源:Frustum.cpp
示例9: MouseWheel
WMSG_RESULT CUIBase::MouseWheel(UINT16 x, UINT16 y, int wheel)
{
if (m_bHide)
return WMSG_FAIL;
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
WMSG_RESULT ret = WMSG_FAIL;
if (wheel > 0)
OnMouseWheelUp();
else if (wheel < 0)
OnMouseWheelDown();
ret = OnMouseWheel(x, y, wheel);
if (ret == WMSG_FAIL)
ret = MouseWheelChild(x, y, wheel);
return ret;
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:22,代码来源:UIBase.cpp
示例10: if
//=================================================================================================
void ListBox::Update(float dt)
{
if(extended)
{
if(menu->visible)
{
// powinno byæ aktualizowane tu ale niestety wed³ug kolejnoœci musi byæ na samym pocz¹tku
//menu->Update(dt);
if(!menu->focus)
menu->visible = false;
}
else if(mouse_focus && Key.Focus() && PointInRect(GUI.cursor_pos, global_pos, size) && Key.PressedRelease(VK_LBUTTON))
{
menu->global_pos = global_pos + INT2(0,size.y);
if(menu->global_pos.y+menu->size.y >= GUI.wnd_size.y)
menu->global_pos.y = GUI.wnd_size.y-menu->size.y;
menu->visible = true;
menu->focus = true;
}
}
else
{
if(mouse_focus && Key.Focus() && PointInRect(GUI.cursor_pos, global_pos, real_size) && Key.PressedRelease(VK_LBUTTON))
{
int n = (GUI.cursor_pos.y-global_pos.y+int(scrollbar.offset))/20;
if(n >= 0 && n < (int)items.size() && n != selected)
{
selected = n;
if(e_change_index)
e_change_index(n);
}
}
if(IsInside(GUI.cursor_pos))
scrollbar.ApplyMouseWheel();
scrollbar.Update(dt);
}
}
开发者ID:edeksumo,项目名称:carpg,代码行数:39,代码来源:ListBox.cpp
示例11: Update
void CClanMemberItem::Update( POINT ptMouse )
{
CTDialog* pDlg = CTDialog::GetProcessMouseOverDialog();
if( pDlg && pDlg->GetDialogType() != DLG_TYPE_CLAN )
return;
if( IsInside( ptMouse.x, ptMouse.y) && m_iChannelNo != 0xFF)
{
m_Info.Clear();
POINT ptDraw = m_sPosition;
ptDraw.y -= 50;
ptDraw.x += 25;
m_Info.SetPosition( ptDraw );
m_Info.AddString( CStr::Printf("%s: %d", CStringManager::GetSingleton().GetAbility( AT_LEVEL ), m_nLevel ) );
m_Info.AddString( CStr::Printf("%s: %s", CStringManager::GetSingleton().GetAbility( AT_CLASS ), m_strJob.c_str() ) );
m_Info.AddString( CStr::Printf("%s: %d","Channel", m_iChannelNo ) );
CToolTipMgr::GetInstance().RegistInfo( m_Info );
}
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:23,代码来源:ClanMemberItem.cpp
示例12: LOWORD
unsigned int CSlotBuyPrivateStore::Process( UINT uiMsg,WPARAM wParam,LPARAM lParam )
{
POINT pt = { LOWORD( lParam ), HIWORD( lParam ) };
if( !IsInside( pt.x, pt.y )) return 0;
CIcon* pIcon = GetIcon();
if( pIcon && uiMsg == WM_LBUTTONDOWN && GetAsyncKeyState( VK_SHIFT ) < 0 )
{
CIconItem* pItemIcon = (CIconItem*)pIcon;
if( m_bExhibition )
{
CPrivateStore::GetInstance().RemoveItemBuyList( pItemIcon->GetIndex() );
}
else
{
CTDialog* pDlg = g_itMGR.FindDlg( DLG_TYPE_GOODS );
if( pDlg )
{
CGoodsDlg* pGoodsDlg = (CGoodsDlg*)pDlg;
pGoodsDlg->SetIcon( pItemIcon );
pGoodsDlg->SetType( CGoodsDlg::ADD_BUYLIST );
g_itMGR.OpenDialog( DLG_TYPE_GOODS );
}
}
return uiMsg;
}
if( m_bExhibition )
{
if( uiMsg == WM_LBUTTONDOWN )
return uiMsg;
return 0;
}
return CSlot::Process( uiMsg, wParam, lParam );
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:37,代码来源:CSlot.cpp
示例13: IsInside
int EditBox::HandleEvent(MouseEvent* evt){
if(!Visible()) return 0;
if(evt->button != LBUTTON) return 0;
bool inside = IsInside(evt->pos);
if(evt->type == BUTTON_DOWN && inside){
mClicked = true;
mClickPos = evt->pos;
UiState::mFocus = this;
}else if(evt->type == BUTTON_UP){
mClicked = false;
if(!inside) return 0;
int cStart = GetCaretFromX(mClickPos.x - mPosition.x);
int cEnd = GetCaretFromX(evt->pos.x - mPosition.x);
mCaret = cEnd;
if(cStart == cEnd){
mSelectStart = mCaret;
mSelectEnd = mCaret;
}
}
return mID;
}
开发者ID:exjam,项目名称:r3e,代码行数:24,代码来源:EditBox.cpp
示例14: Move
WMSG_RESULT CUITrade::OnMouseMove( UINT16 x, UINT16 y, MSG* pMsg )
{
if (m_bHide)
return WMSG_FAIL;
if( m_bDrag && ( pMsg->wParam & MK_LBUTTON ) )
{
int ndX = x - m_nOriX;
int ndY = y - m_nOriY;
m_nOriX = x;
m_nOriY = y;
Move( ndX, ndY );
return WMSG_SUCCESS;
}
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
UIMGR()->SetMouseCursorInsideUIs();
return CUIBase::OnMouseMove(x, y, pMsg);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:24,代码来源:UITrade.cpp
示例15: Move
WMSG_RESULT CUIPortal::OnMouseMove( UINT16 x, UINT16 y, MSG* pMsg )
{
if (m_bHide)
return WMSG_FAIL;
if( m_bDrag && ( pMsg->wParam & MK_LBUTTON ) )
{
int ndX = x - m_nOriX;
int ndY = y - m_nOriY;
m_nOriX = x;
m_nOriY = y;
Move( ndX, ndY );
return WMSG_SUCCESS;
}
if (IsInside(x, y) == FALSE)
return WMSG_FAIL;
CUIManager::getSingleton()->SetMouseCursorInsideUIs();
return WMSG_FAIL;
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:24,代码来源:UIPortalNew.cpp
示例16: IsInside
bool cBoundingBox::IsInside(const Vector3d & a_Point)
{
return IsInside(m_Min, m_Max, a_Point);
}
开发者ID:36451,项目名称:MCServer,代码行数:4,代码来源:BoundingBox.cpp
示例17: SaveGame
void SaveGame(const std::string& filename, const ServerSaveGameData& server_save_game_data,
const std::vector<PlayerSaveGameData>& player_save_game_data, const Universe& universe,
const EmpireManager& empire_manager, const SpeciesManager& species_manager,
const CombatLogManager& combat_log_manager, const GalaxySetupData& galaxy_setup_data,
bool multiplayer)
{
ScopedTimer timer("SaveGame: " + filename, true);
bool use_binary = GetOptionsDB().Get<bool>("binary-serialization");
DebugLogger() << "SaveGame(" << (use_binary ? "binary" : "zlib-xml") << ") filename: " << filename;
GetUniverse().EncodingEmpire() = ALL_EMPIRES;
DebugLogger() << "Compiling save empire and preview data";
std::map<int, SaveGameEmpireData> empire_save_game_data = CompileSaveGameEmpireData(empire_manager);
SaveGamePreviewData save_preview_data;
CompileSaveGamePreviewData(server_save_game_data, player_save_game_data, empire_save_game_data, save_preview_data);
// reinterpret save game data as header data for uncompressed header
std::vector<PlayerSaveHeaderData> player_save_header_data;
for (std::vector<PlayerSaveGameData>::const_iterator it = player_save_game_data.begin();
it != player_save_game_data.end(); ++it)
{
player_save_header_data.push_back(*it);
}
try {
fs::path path = FilenameToPath(filename);
// A relative path should be relative to the save directory.
if (path.is_relative()) {
path = GetSaveDir()/path;
DebugLogger() << "Made save path relative to save dir. Is now: " << path;
}
if (multiplayer) {
// Make sure the path points into our save directory
if (!IsInside(path, GetSaveDir())) {
path = GetSaveDir() / path.filename();
}
}
// set up output archive / stream for saving
fs::ofstream ofs(path, std::ios_base::binary);
if (!ofs)
throw std::runtime_error(UNABLE_TO_OPEN_FILE);
if (use_binary) {
DebugLogger() << "Creating binary oarchive";
freeorion_bin_oarchive boa(ofs);
boa << BOOST_SERIALIZATION_NVP(save_preview_data);
boa << BOOST_SERIALIZATION_NVP(galaxy_setup_data);
boa << BOOST_SERIALIZATION_NVP(server_save_game_data);
boa << BOOST_SERIALIZATION_NVP(player_save_header_data);
boa << BOOST_SERIALIZATION_NVP(empire_save_game_data);
boa << BOOST_SERIALIZATION_NVP(player_save_game_data);
boa << BOOST_SERIALIZATION_NVP(empire_manager);
boa << BOOST_SERIALIZATION_NVP(species_manager);
boa << BOOST_SERIALIZATION_NVP(combat_log_manager);
Serialize(boa, universe);
DebugLogger() << "Done serializing";
} else {
// Two-tier serialization:
// main archive is uncompressed serialized header data first
// then contains a string for compressed second archive
// that contains the main gamestate info
// allocate buffers for serialized gamestate
DebugLogger() << "Allocating buffers for XML serialization...";
std::string serial_str, compressed_str;
try {
serial_str.reserve( std::pow(2.0, 29.0));
compressed_str.reserve(std::pow(2.0, 26.0));
} catch (...) {
DebugLogger() << "Unable to preallocate full serialization buffers. Attempting serialization with dynamic buffer allocation.";
}
// wrap buffer string in iostream::stream to receive serialized data
typedef boost::iostreams::back_insert_device<std::string> InsertDevice;
InsertDevice serial_inserter(serial_str);
boost::iostreams::stream<InsertDevice> s_sink(serial_inserter);
// create archive with (preallocated) buffer...
freeorion_xml_oarchive xoa(s_sink);
// serialize main gamestate info
xoa << BOOST_SERIALIZATION_NVP(player_save_game_data);
xoa << BOOST_SERIALIZATION_NVP(empire_manager);
xoa << BOOST_SERIALIZATION_NVP(species_manager);
xoa << BOOST_SERIALIZATION_NVP(combat_log_manager);
Serialize(xoa, universe);
s_sink.flush();
// wrap gamestate string in iostream::stream to extract serialized data
typedef boost::iostreams::basic_array_source<char> SourceDevice;
SourceDevice source(serial_str.data(), serial_str.size());
boost::iostreams::stream<SourceDevice> s_source(source);
//.........这里部分代码省略.........
开发者ID:Hacklin,项目名称:freeorion,代码行数:101,代码来源:SaveLoad.cpp
示例18: AlphaGetPointer
/**
* Returns pointer to alpha data for pixel (x,y).
*
* \author ***bd*** 2.2004
*/
BYTE* CxImage::AlphaGetPointer(const long x,const long y)
{
if (pAlpha && IsInside(x,y)) return pAlpha+x+y*head.biWidth;
return 0;
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:10,代码来源:ximalpha.cpp
示例19: while
/**
* Adds a polygonal region to the existing selection. points points to an array of POINT structures.
* Each structure specifies the x-coordinate and y-coordinate of one vertex of the polygon.
* npoints specifies the number of POINT structures in the array pointed to by points.
*/
bool CxImage::SelectionAddPolygon(POINT *points, long npoints)
{
if (points==NULL || npoints<3) return false;
if (pSelection==NULL) SelectionCreate();
if (pSelection==NULL) return false;
BYTE* plocal = (BYTE*)calloc(head.biWidth*head.biHeight, 1);
RECT localbox = {head.biWidth,0,0,head.biHeight};
long x,y,i=0;
POINT *current,*next,*start;
//trace contour
while (i < npoints){
current = &points[i];
if (current->x!=-1){
if (i==0 || (i>0 && points[i-1].x==-1)) start = &points[i];
if ((i+1)==npoints || points[i+1].x==-1)
next = start;
else
next = &points[i+1];
float beta;
if (current->x != next->x){
beta = (float)(next->y - current->y)/(float)(next->x - current->x);
if (current->x < next->x){
for (x=current->x; x<=next->x; x++){
y = (long)(current->y + (x - current->x) * beta);
if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255;
}
} else {
for (x=current->x; x>=next->x; x--){
y = (long)(current->y + (x - current->x) * beta);
if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255;
}
}
}
if (current->y != next->y){
beta = (float)(next->x - current->x)/(float)(next->y - current->y);
if (current->y < next->y){
for (y=current->y; y<=next->y; y++){
x = (long)(current->x + (y - current->y) * beta);
if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255;
}
} else {
for (y=current->y; y>=next->y; y--){
x = (long)(current->x + (y - current->y) * beta);
if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255;
}
}
}
}
RECT r2;
if (current->x < next->x) {r2.left=current->x; r2.right=next->x; } else {r2.left=next->x ; r2.right=current->x; }
if (current->y < next->y) {r2.bottom=current->y; r2.top=next->y; } else {r2.bottom=next->y ; r2.top=current->y; }
if (localbox.top < r2.top) localbox.top = max(0L,min(head.biHeight-1,r2.top+1));
if (localbox.left > r2.left) localbox.left = max(0L,min(head.biWidth-1,r2.left-1));
if (localbox.right < r2.right) localbox.right = max(0L,min(head.biWidth-1,r2.right+1));
if (localbox.bottom > r2.bottom) localbox.bottom = max(0L,min(head.biHeight-1,r2.bottom-1));
i++;
}
//fill the outer region
long npix=(localbox.right - localbox.left)*(localbox.top - localbox.bottom);
POINT* pix = (POINT*)calloc(npix,sizeof(POINT));
BYTE back=0, mark=1;
long fx, fy, fxx, fyy, first, last,xmin,xmax,ymin,ymax;
for (int side=0; side<4; side++){
switch(side){
case 0:
xmin=localbox.left; xmax=localbox.right+1; ymin=localbox.bottom; ymax=localbox.bottom+1;
break;
case 1:
xmin=localbox.right; xmax=localbox.right+1; ymin=localbox.bottom; ymax=localbox.top+1;
break;
case 2:
xmin=localbox.left; xmax=localbox.right+1; ymin=localbox.top; ymax=localbox.top+1;
break;
case 3:
xmin=localbox.left; xmax=localbox.left+1; ymin=localbox.bottom; ymax=localbox.top+1;
break;
}
//fill from the border points
for(y=ymin;y<ymax;y++){
for(x=xmin;x<xmax;x++){
if (plocal[x+y*head.biWidth]==0){
// Subject: FLOOD FILL ROUTINE Date: 12-23-97 (00:57)
// Author: Petter Holmberg Code: QB, QBasic, PDS
// Origin: [email protected] Packet: GRAPHICS.ABC
first=0;
last=1;
//.........这里部分代码省略.........
开发者ID:JimLiu,项目名称:asptools,代码行数:101,代码来源:ximasel.cpp
示例20: p
bool Rect::IsInside(float x, float y) {
Point p(x, y);
return IsInside(p);
}
开发者ID:mendelson,项目名称:aliens_invasion,代码行数:5,代码来源:Rect.cpp
注:本文中的IsInside函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论