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


C++ CNode::GetType方法代码示例

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


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

示例1: if

int CParentNode::setReadOnlyAttribute4AllNonReadOnlyNodes()
{
	int nRet = 1;
	CNode *pNode;
	CFormulaNode *pForm;
	for( long i = 0; i < GetChildCount(); i++ )
	{
		pNode = GetChild( i );
		if( pNode->GetType() == NODE_PLANETEXT )
		{
			if( !pNode->isReadOnly() )
				nRet = 0;
			else
				pNode->setReadOnly();
		}
		else if( ((CParentNode*) pNode)->GetChildCount() )
		{
			int n = ((CParentNode*) pNode)->setReadOnlyAttribute4AllNonReadOnlyNodes();
			switch( pNode->GetType() )
			{
			case NODE_FORMULA:
				pForm = ((CFormulaNode*)pNode);
				if( !pForm->isReadOnly() )
				{
					if( ::mml_is_cm_token( pForm->to_mathml_data.name ) )
					{
						if( n && pForm->GetParent() )
						{
							CFormulaNode *frmParent = pForm->GetParent()->getParentContentFormulaNode( 1 );
							if( frmParent )
								pForm->setReadOnly();
						}
					}
					else
						nRet = 0;
				}
				break;
			case NODE_LINE:
				if( n ) pNode->setReadOnly();
				break;
			case NODE_FRAME:
				pNode->setReadOnly();
				break;
			default:
				break;
			}
		}
		else
			nRet = 0;
	}
	return nRet;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:52,代码来源:ni_parent.cpp

示例2: getFormulaLineChild

CLineNode* CFormulaNode::getFormulaLineChild( long frame_idx, long child_idx )
{
	CNode* pFrame = GetChild( frame_idx );

	if( !pFrame || pFrame->GetType() != NODE_FRAME )
		return NULL;

	CNode* fch = ((CFrameNode*) pFrame)->GetChild( child_idx );
	if( !fch || fch->GetType() != NODE_LINE)
		return NULL;

	return (CLineNode*) fch;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:13,代码来源:ni_formula.cpp

示例3: Initialize

void CControl::Initialize()
{
    super::Initialize();
    m_bUninitialize = false;
    if ( strcmp( m_strName.c_str(), DEFAULT_CONTROL_NAME ) == 0)
    {
        SetName( GetDefaultName() );
    }
    else
    {
        CWindowManager::GetInstance()->RegisterControl( this );
    }
    CalcInheritColor();
    CRenderTarget* pMainRenderTarget = CRenderManager::GetInstance()->GetCurrentRenderTarget();
    BEATS_ASSERT( pMainRenderTarget );
    CNode* pParentNode = GetParentNode();
    if ( nullptr == pParentNode)
    {
        CWindowManager::GetInstance()->AddToRoot( this );
    }
    if (nullptr == pParentNode || pParentNode->GetType() != eNT_NodeGUI )
    {
        //update control vertex by render target
        OnParentSizeChange( (float)pMainRenderTarget->GetWidth(), (float)pMainRenderTarget->GetHeight());
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:26,代码来源:Control.cpp

示例4: getFormulaDeepFormulaChild

CFormulaNode* CFormulaNode::getFormulaDeepFormulaChild( long frame_idx, long child_idx )
{
	CNode *ret = getFormulaDeepChild( frame_idx, child_idx );
	if( !ret || ret->GetType() != NODE_FORMULA )
		return NULL;
	return (CFormulaNode*) ret;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:7,代码来源:ni_formula.cpp

示例5: InsertMMLFormulaNode_OTHERS

CFormulaNode* CLineNode::InsertMMLFormulaNode_OTHERS( FXmlBtn *ptrFXmlBtn, AST_TXML_Compound *node, int is_hidden )
{
	CFormulaNode *new_node = 0;
	CFrameNode *pFrameNode = 0;
	CNode *pCurNode = 0;

	if( !ptrFXmlBtn )
		return NULL; // error: Internal error

	if( ptrFXmlBtn->getNodeType() == NODE_FORMULA )
	{
		new_node = CreateFormulaNode( *ptrFXmlBtn );
		if( !new_node ) return NULL; // error: Internal error

		pFrameNode = (CFrameNode *)GetFrameNode();
		if( pFrameNode ) new_node->SetLevel( pFrameNode->GetLevel() );
		AddChild( new_node );

		if( node )
		{
			pCurNode = new_node->GetFirstChild();
			if( pCurNode && pCurNode->GetType() == NODE_FRAME )
			{
				if( ((CFrameNode*)pCurNode)->GetFirstChild() )
					((CFrameNode*)pCurNode)->DeleteChild( ((CFrameNode*)pCurNode)->GetFirstChild() );
				pCurNode->read_mathml( node );
			}
		}
	}
	if( new_node && is_hidden )
		new_node->setHidden();
	return new_node;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:33,代码来源:n_rmml_pm_formula.cpp

示例6: getSemanticsOrCTokenNodeWrapped

CFormulaNode* CFormulaNode::getSemanticsOrCTokenNodeWrapped()
{
	for( CNode *curNode = this; curNode != 0; curNode = curNode->GetParent() )
	{
		if( curNode->GetType() == NODE_FORMULA && curNode->to_mathml_data.is_content != 0 )
		{
			if( !xml_strcmp( curNode->to_mathml_data.name, FBL_TAG_semantics ) || 
				!xml_strcmp( curNode->to_mathml_data.name, FBL_TAG_annotation ) || 
				::mml_is_cm_token( curNode->to_mathml_data.name ) )
				return (CFormulaNode*)curNode;
			else if( curNode->to_mathml_data.name == FBL_TAG_annotation_xml )
			{
				QString attrValue = _T("");
				struct HMathMLAttr mml_attr_by_this_node( getMathMLAttr() );
				if( mml_attr_by_this_node.getFilteredAttr( FBL_ATTR_encoding, attrValue ) == 0 &&
					attrValue == FBL_VAL_MathML_Content )
				{
					continue;
				}
				return (CFormulaNode*)curNode;
			}
		}
	}
	return 0;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:25,代码来源:ni_formula.cpp

示例7: getSingleChild

CNode* CFormulaNode::getSingleChild( long frame_idx )
{
	CNode *node = GetChild( frame_idx );
	if( !node || node->GetType() != NODE_FRAME ) return 0;
	CFrameNode *frame = (CFrameNode*)node;

	if( frame->GetChildCount() != 1 ) return 0;
	node = frame->GetFirstChild();
	if( !node || node->GetType() != NODE_LINE ) return 0;
	CLineNode *line = (CLineNode*)node;

	if( line->GetChildCount() != 1 ) return 0;
	node = line->GetFirstChild();
	if( !node ) return 0;

	return node;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:17,代码来源:ni_formula.cpp

示例8: WorldToLocal

void CControl::WorldToLocal(float &x, float &y)
{
    CNode* pParent = GetParentNode();
    if( pParent && pParent->GetType() == eNT_NodeGUI )
    {
       down_cast<CControl*>(pParent)->WorldToLocal(x, y);
    }
    ParentToLocal(x, y);
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:9,代码来源:Control.cpp

示例9: LocalToWorld

void CControl::LocalToWorld(float &x, float &y)
{
    LocalToParent(x, y);

    CNode* pParent = GetParentNode();
    if( pParent && pParent->GetType() == eNT_NodeGUI )
    {
        down_cast<CControl*>(pParent)->LocalToWorld(x, y);
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:10,代码来源:Control.cpp

示例10: getSingleFormulaChild_ContentEmptyFrame

CFormulaNode* CFormulaNode::getSingleFormulaChild_ContentEmptyFrame( long frame_idx )
{
	CNode *node = getSingleChild( frame_idx );
	if( !node || node->GetType() != NODE_FORMULA ) return 0;
	if( (node->to_mathml_data.is_content || node->isAutodetectContent()) &&
		((CFormulaNode*) node)->getCalcButtonID() == HF_BTNID_EMPTY_FRAME )
	{
		return (CFormulaNode*) node;
	}
	return 0;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:11,代码来源:ni_formula.cpp

示例11: getSingleFormulaChild_ContentText

CPlaneText* CFormulaNode::getSingleFormulaChild_ContentText( long frame_idx )
{
	CNode *node = getSingleChild( frame_idx );
	if( !node || node->GetType() != NODE_FORMULA ||
		((CFormulaNode*) node)->getCalcButtonID() != HF_BTNID_EMPTY_FRAME )
		return 0;
	if( node->to_mathml_data.is_content || node->isAutodetectContent() )
	{
		return ((CFormulaNode*) node)->getSingleTextChild();
	}
	return 0;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:12,代码来源:ni_formula.cpp

示例12: HandleTouchEvent

bool CControl::HandleTouchEvent( CTouchEvent* event )
{
    bool bRet = false;
    if ( m_bResiveTouchEvent )
    {
        const CVec2& pos = event->GetTouchPoint();
        if ( event->GetType() == eET_EVENT_TOUCH_MOVED )
        {
            m_bTouchInRect = HitTest(pos.x, pos.y);
            if ( m_bTouchInRect )
            {
                OnTouchMove( pos.x, pos.y );
                bRet = true;
            }
            else
            {
                if ( m_bClick )
                {
                    StopClickAnimation();
                }
            }
        }
        else
        {
            if( event->GetType() == eET_EVENT_TOUCH_ENDED && m_bClick )
            {
                OnTouchEnded( pos.x, pos.y );
            }
            else
            {
                bRet = HitTest(pos.x, pos.y);
                if(bRet)
                {
                    if ( m_bDispatchEventToParent )
                    {
                        CNode* pParent = GetParentNode();
                        bRet = pParent && pParent->GetType() == eNT_NodeGUI;
                        if (bRet)
                        {
                            down_cast<CControl*>(pParent)->DispatchEvent( event->GetType(), pos.x, pos.y, event->GetDelta() );
                        }
                    }
                    else
                    {
                        DispatchEvent( event->GetType(), pos.x, pos.y, event->GetDelta() );
                    }
                }
            }
        }
    }
    return bRet;
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:52,代码来源:Control.cpp

示例13: getChildDimensions_Vertical

void CFormulaNode::getChildDimensions_Vertical( RealFde *destDim )
{
	CNode *padded = getSingleChild();
	if( padded && padded->getAlignmentType() == FBtnChildPos::MSPACE_Exact_HeightDepth )
	{
		if( padded->GetType() == NODE_FORMULA )
		{
			((CFormulaNode*)padded)->calculatePadded_Vertical( destDim );
			return;
		}
		else if( padded->GetType() == NODE_PLANETEXT )
		{
			destDim[ MML_MPADDED_UNITS_HEIGHT ] = padded->getMMLHeight();
			destDim[ MML_MPADDED_UNITS_DEPTH ]  = padded->getMMLDepth();
			return;
		}
	}

	RealFde ascent = ::calculateCurrentTextAscent( GetLevel() );
	destDim[ MML_MPADDED_UNITS_DEPTH ] = ::calculateCurrentDepth( GetLevel(), ascent );
	destDim[ MML_MPADDED_UNITS_HEIGHT ] = ::calculateCurrentHeight( GetChild( 0 ), 1, GetLevel(), ascent );
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:22,代码来源:ni_formula.cpp

示例14: getContentFormulaSingleLineChild

long CFormulaNode::getUpperFormulaChildrenCount4Content()
{
	long lRet = 0;
	CLineNode *_line = getContentFormulaSingleLineChild();
	if( _line )
	{
		CNode *pNode;
		for( long i = 0; i < _line->GetChildCount(); i++ )
		{
			pNode = _line->GetChild( i );
			if( pNode->GetType() == NODE_FORMULA )
				lRet++;
		}
	}
	return lRet;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:16,代码来源:ni_formula.cpp

示例15: CalcInheritColor

void CControl::CalcInheritColor()
{
    CNode* pParent = GetParentNode();
    if ( pParent && pParent->GetType() == eNT_NodeGUI )
    {
        CControl* m_pParentNode = (CControl*)pParent;
        CColor inheritColor = m_pParentNode->GetColor( false );
        m_colorInherit.r = (unsigned char)(m_color.r * 0.5f + inheritColor.r * 0.5f);
        m_colorInherit.g = (unsigned char)(m_color.g * 0.5f + inheritColor.g * 0.5f);
        m_colorInherit.b = (unsigned char)(m_color.b * 0.5f + inheritColor.b * 0.5f);
        m_colorInherit.a = (unsigned char)(m_color.a * 0.5f + inheritColor.a * 0.5f);
    }
    else
    {
        m_colorInherit = m_color;
    }
}
开发者ID:BeyondEngine,项目名称:BeyondEngine,代码行数:17,代码来源:Control.cpp


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