当前位置: 首页>>代码示例>>C++>>正文


C++ QSharedPointer::GetDisplay方法代码示例

本文整理汇总了C++中QSharedPointer::GetDisplay方法的典型用法代码示例。如果您正苦于以下问题:C++ QSharedPointer::GetDisplay方法的具体用法?C++ QSharedPointer::GetDisplay怎么用?C++ QSharedPointer::GetDisplay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSharedPointer的用法示例。


在下文中一共展示了QSharedPointer::GetDisplay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoExecute

void GISSetFieldAttributeMsgCommand::DoExecute() throw (GException)
{
	LOG_LEVEL3("DoExecute()");

	GISAbsData* pGISAbsData = GetData();


	QSharedPointer<GISModel> pModel = GISModelSingleton::GetInstance()->GetModel();

    {
        QMutexLocker mtxScope(pModel->GetMutex());

        GDisplay* poDisplay = pModel->GetDisplay(pGISAbsData->GetDisplay());

        GScreen* poScreen = poDisplay->GetScreen(pGISAbsData->GetScreen());

        GSegment* poSegment = poScreen->GetSegment(pGISAbsData->GetSegment());

        GTextField* poField = poSegment->GetField(pGISAbsData->GetField());
        if( poField != NULL )
        {
            poField->SetAttribute(pGISAbsData->GetAttr());
        }
    }

}
开发者ID:marianovolker,项目名称:jmps-public,代码行数:26,代码来源:GISSetFieldAttributeMsgCommand.cpp

示例2: DoExecute

void GISDisplaySegmentMsgCommand::DoExecute() throw (GException)
{
	LOG_LEVEL3("DoExecute()");

	GISAbsData* pGISAbsData = GetData();

	QSharedPointer<GISModel> pModel = GISModelSingleton::GetInstance()->GetModel();
    {
        QMutexLocker mtxScope(pModel->GetMutex());

        GDisplay* poDisplay = pModel->GetDisplay(pGISAbsData->GetDisplay());

        GScreen* poScreen = poDisplay->GetScreen(pGISAbsData->GetScreen());

        GSegment* poSegment = poScreen->GetSegment(pGISAbsData->GetSegment());

		//Erase the content of the if and else branches. Leave the empty if commented.
		//Whichever value the attribute has, make a gsegment clon and do what is done to the poSegment in if branch, to the clon
		//	if (pGISAbsData->GetAttr()==GAttributeEnum::eNotErasePreviousLocation)
		//	{// If Attr is not zero call old setters and getters
		//	}
		//	else// GetAttr is eErasePreviousLocation otherwise ( all other options where discarded in Validate of MsgData ).
		//	{
		//	}

		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		//	GSegment *poClonedSegment = GSegment::Clone(poSegment);
		//
		//	if (pGISAbsData->GetXpos())
		//		poClonedSegment->SetXPos(pGISAbsData->GetXpos());
		//
		//	if (pGISAbsData->GetYpos())
		//		poClonedSegment->SetYPos(pGISAbsData->GetYpos());
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// Java implements this command in the following way, the Spec seems to prefer the one commented above.
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if (pGISAbsData->GetXpos())
        {
            poSegment->SetXPos(pGISAbsData->GetXpos());
        }

        if (pGISAbsData->GetYpos())
        {
            poSegment->SetYPos(pGISAbsData->GetYpos());
        }

        GSegment *poClonedSegment = GSegment::Clone(poSegment);

		if (poClonedSegment)
		{
			poClonedSegment->SetVisible(true);  
		}
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        //Call Update section (instead of updateview) with a pointer to the clon (without validation)
        pModel->UpdateViewSection(poClonedSegment,pGISAbsData->GetSynchronousRequest());
    }
}
开发者ID:marianovolker,项目名称:jmps-public,代码行数:58,代码来源:GISDisplaySegmentMsgCommand.cpp

示例3: DoExecute

void GISAddDisplayMsgCommand::DoExecute() throw (GException)
{
	LOG_LEVEL3("DoExecute()");

	GISAbsData* pGISAbsData = GetData();

	QSharedPointer<GISModel> pModel = GISModelSingleton::GetInstance()->GetModel();

    {
        QMutexLocker mtxScope(pModel->GetMutex());

        GDisplay* poDisplay = pModel->GetDisplay(pGISAbsData->GetDisplay());

        if ( poDisplay == NULL )
        {
            QList<GDisplay *> lstDisplays = pModel->GetAllDisplays();

            if( lstDisplays.count() == 0 )
            {
                pModel->AddDisplay(new GDisplay(pGISAbsData->GetDisplay()));
            }
        }
    }
}
开发者ID:marianovolker,项目名称:jmps-public,代码行数:24,代码来源:GISAddDisplayMsgCommand.cpp

示例4: Validate

void GISSetFieldAttributeMsgData::Validate() throw(GException)
{
	/*
	 *05 = Field number already used
	 *06 = Invalid display number or display number does not exist
	 *07 = Invalid screen number or screen number does not exist
	 *08 = Invalid segment number or segment number does not exist
	 *09 = InvalidFieldNumberOrFieldNumberDoesNotExist
	 *12 = Invalid Attribute
	*/
	LOG_LEVEL4("Validate()");

	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//TODO: DisplayManager Constrain - If improvement is done on Specs, this should be removed.
	if ( GetDisplay() != 1)
	{
		throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidDisplayNumberOrDisplayNumberDoesNotExist);
	}
	if ( GetScreen() == 0)
	{
		throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidScreenNumberOrScreenNumberDoesNotExist);
	}
	if( GetSegment() == 0 )
	{
		throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidSegmentNumberOrSegmentNumberDoesNotExist);
	}
	if(	GetField() == 0 )
	{
		throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidFieldNumberOrFieldNumberDoesNotExist);
	}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	QSharedPointer<GISModel> pModel = GISModelSingleton::GetInstance()->GetModel();

    {
        QMutexLocker mtxScope(pModel->GetMutex());
	
        GDisplay* poDisplay = pModel->GetDisplay(GetDisplay());
        if( poDisplay == NULL )
        {
            throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidDisplayNumberOrDisplayNumberDoesNotExist);
        }
        GScreen* poScreen = poDisplay->GetScreen(GetScreen());
        if( poScreen == NULL )
        {
            throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidScreenNumberOrScreenNumberDoesNotExist);
        }
        GSegment* poSegment = poScreen->GetSegment(GetSegment());
        if( poSegment == NULL )
        {
            throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidSegmentNumberOrSegmentNumberDoesNotExist);
        }
        GTextField* poField = poSegment->GetField(GetField());
        if( poField == NULL )
        {
            //NGP 121, GPT 14/10/09
            throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidFieldNumberOrFieldNumberDoesNotExist);
        }
        int iAtt = GetAttr();
        if( !((iAtt > GAttributeEnum::eBeforeFirstAttrib) && (iAtt < GAttributeEnum::eAfterLastAttrib)) )
        {
            throw GIS_EXCEPTION(GISCommandStatusEnum::eInvalidAttribute);
        }
    }
}
开发者ID:marianovolker,项目名称:jmps-public,代码行数:65,代码来源:GISSetFieldAttributeMsgData.cpp


注:本文中的QSharedPointer::GetDisplay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。