• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Visual类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Visual的典型用法代码示例。如果您正苦于以下问题:C++ Visual类的具体用法?C++ Visual怎么用?C++ Visual使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: OnFirstUpdate

void SkinController::OnFirstUpdate()
{
    // Get access to the vertex buffer positions to store the blended targets.
    Visual* visual = reinterpret_cast<Visual*>(mObject);
    VertexBuffer* vbuffer = visual->GetVertexBuffer().get();
    if (mNumVertices == static_cast<int>(vbuffer->GetNumElements()))
    {
        // Get the position data.
        VertexFormat vformat = vbuffer->GetFormat();
        int const numAttributes = vformat.GetNumAttributes();
        for (int i = 0; i < numAttributes; ++i)
        {
            VASemantic semantic;
            DFType type;
            unsigned int unit, offset;
            if (vformat.GetAttribute(i, semantic, type, unit, offset))
            {
                if (semantic == VA_POSITION && (type == DF_R32G32B32_FLOAT 
                    || type == DF_R32G32B32A32_FLOAT))
                {
                    mPosition = vbuffer->GetData() + offset;
                    mStride = vformat.GetVertexSize();
                    mCanUpdate = true;
                    break;
                }
            }
        }
    }

    mCanUpdate = (mPosition != nullptr);
}
开发者ID:c0g,项目名称:FaceWarpApp,代码行数:31,代码来源:GteSkinController.cpp


示例2: while

Point MouseEventArgs::GetPosition(UIElement* relativeTo)
{
	gm::matrix3f m = gm::matrix3f::getIdentity();

	Visual* p = relativeTo;
	Visual* parent;
	while (parent = p->get_Parent())
	{
		Transform* transform = p->get_Transform();
		if (transform)
		{
			m *= transform->get_Matrix();
		}

		p = parent;
	}

	return m.getInverse().transform(m_clientpos);

	/*
	Visual* visual = dynamic_cast<Visual*>(relativeTo);
	ASSERT(visual);
	return visual->WindowToElement(m_windowX, m_windowY);
	*/
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:25,代码来源:MouseEventArgs.cpp


示例3: DataMap

void Pdb::Explorer()
{
	VectorMap<String, Value> prev = DataMap(explorer);
	explorer.Clear();
	try {
		String x = ~expexp;
		if(!IsNull(x)) {
			CParser p(x);
			Val v = Exp(p);
			Vis(explorer, "=", prev, Visualise(v));
			if(v.type >= 0 && v.ref == 0 && !v.rvalue)
				Explore(v, prev);
			if(v.ref > 0 && GetRVal(v).address)
				for(int i = 0; i < 20; i++)
					Vis(explorer, Format("[%d]", i), prev, Visualise(DeRef(Compute(v, RValue(i), '+'))));
		}
	}
	catch(CParser::Error e) {
		Visual v;
		v.Cat(e, LtRed);
		explorer.Add("", RawPickToValue(v));
	}
	exback.Enable(exprev.GetCount());
	exfw.Enable(exnext.GetCount());
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:25,代码来源:Data.cpp


示例4: get_Clip

geometry UIElement::MakeVisibleGeometry(geometry clip)
{
	m_visibleGeometryValid = true;

	//gm::RectF bounds = clip.GetBounds();

	geometry clipThis = get_Clip();
	if (clipThis != nullptr)
	{
		clip &= clipThis;
	}

#ifdef _DEBUG
	gm::RectF bounds = clip.GetBounds();
#endif

	geometry geom = GetHitGeometry();
#ifdef _DEBUG
	gm::RectF bounds2 = geom.GetBounds();
#endif

	clip &= geom;

#ifdef _DEBUG
	gm::RectF bounds3 = clip.GetBounds();
#endif

	size_t nchildren = GetChildrenCount();
	for (size_t i = nchildren; i > 0; --i)
	{
		Visual* child = GetChild(i-1);

		geometry geom2 = child->MakeVisibleGeometry(clip);

		clip |= geom2;
	}

	UIElement* shadowTree = get_ShadowTree();
	if (shadowTree)
	{
		geometry geom2 = shadowTree->MakeVisibleGeometry(clip);

#ifdef _DEBUG
	gm::RectF bounds5 = geom2.GetBounds();
#endif

		clip |= geom2;
	}

#ifdef _DEBUG
	gm::RectF bounds4 = clip.GetBounds();
#endif

	set_VisibleGeometry(clip);

	return clip;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:57,代码来源:UIElement.cpp


示例5: assertion

//----------------------------------------------------------------------------
bool MorphController::Update (double applicationTime)
{
    // The key interpolation uses linear interpolation.  To get higher-order
    // interpolation, you need to provide a more sophisticated key (Bezier
    // cubic or TCB spline, for example).

    if (!Controller::Update(applicationTime))
    {
        return false;
    }

    // Get access to the vertex buffer to store the blended targets.
    Visual* visual = StaticCast<Visual>(mObject);
    assertion(visual->GetVertexBuffer()->GetNumElements() == mNumVertices,
        "Mismatch in number of vertices.\n");

    VertexBufferAccessor vba(visual);

    // Set vertices to target[0].
    APoint* baseTarget = mVertices[0];
    int i;
    for (i = 0; i < mNumVertices; ++i)
    {
        vba.Position<Float3>(i) = baseTarget[i];
    }

    // Look up the bounding keys.
    float ctrlTime = (float)GetControlTime(applicationTime);
    float normTime;
    int i0, i1;
    GetKeyInfo(ctrlTime, normTime, i0, i1);

    // Add the remaining components in the convex composition.
    float* weights0 = mWeights[i0];
    float* weights1 = mWeights[i1];
    for (i = 1; i < mNumTargets; ++i)
    {
        // Add in the delta-vertices of target[i].
        float coeff = (1.0f-normTime)*weights0[i-1] + normTime*weights1[i-1];
        AVector* target = (AVector*)mVertices[i];
        for (int j = 0; j < mNumVertices; ++j)
        {
            APoint position = vba.Position<Float3>(j);
            position += coeff*target[j];
            vba.Position<Float3>(j) = position;
        }
    }

    visual->UpdateModelSpace(Visual::GU_NORMALS);
    Renderer::UpdateAll(visual->GetVertexBuffer());
    return true;
}
开发者ID:2asoft,项目名称:GeometricTools,代码行数:53,代码来源:Wm5MorphController.cpp


示例6: Visualise

void Pdb::AddThis(const VectorMap<String, Val>& m, adr_t address, const VectorMap<String, Value>& prev)
{
	for(int i = 0; i < m.GetCount() && self.GetCount() < 2000; i++) {
		Val mv = m[i];
		mv.address += address;
		Visual vis;
		try {
			vis = Visualise(mv);
		}
		catch(CParser::Error e) {
			vis.Cat(e, SColorDisabled);
		}
		Vis(self, m.GetKey(i), prev, vis);
	}
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:15,代码来源:Data.cpp


示例7: assertion

//----------------------------------------------------------------------------
void Delaunay3D::ChangeTetraStatus (int index, const Float4& color,
    bool enableWire)
{
    Visual* tetra = DynamicCast<Visual>(mScene->GetChild(1 + index));
    assertion(tetra != 0, "Expecting a Visual object.\n");
    VertexBufferAccessor vba(tetra);
    for (int i = 0; i < 4; ++i)
    {
        vba.Color<Float4>(0, i) = color;
    }
    mRenderer->Update(tetra->GetVertexBuffer());

    VisualEffectInstance* instance = tetra->GetEffectInstance();
    instance->GetEffect()->GetWireState(0, 0)->Enabled = enableWire;
}
开发者ID:rasslingcats,项目名称:calico,代码行数:16,代码来源:Delaunay3D.cpp


示例8: p

void Pdb::TryAuto(const String& exp, const VectorMap<String, Value>& prev)
{
	if(autos.Find(exp) < 0) {
		Visual r;
		try {
			CParser p(exp);
			Val v = Exp(p);
			Visualise(r, v, 2);
		}
		catch(CParser::Error) {
			r.Clear();
		}
		if(r.part.GetCount())
			Vis(autos, exp, prev, r);
	}
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:16,代码来源:Data.cpp


示例9: Draw

//----------------------------------------------------------------------------
void SMShadowEffect::Draw (Renderer* renderer, const VisibleSet& visibleSet)
{
    const int numVisible = visibleSet.GetNumVisible();
    for (int j = 0; j < numVisible; ++j)
    {
        // Replace the object's effect instance by the shadow-effect instance.
        Visual* visual = (Visual*)visibleSet.GetVisible(j);
        VisualEffectInstancePtr save = visual->GetEffectInstance();
        visual->SetEffectInstance(mInstance);

        // Draw the object using the shadow effect.
        renderer->Draw(visual);

        // Restore the object's effect instance.
        visual->SetEffectInstance(save);
    }
}
开发者ID:vijaynerella,项目名称:GeometricTools,代码行数:18,代码来源:SMShadowEffect.cpp


示例10: GetWorldTransform

void Camera::Render(Context* context)
{
	float aspect = 1.0f;
	cachedproj.SetPerspective(fov, aspect, 0.1f, 100.0f);
	cachedview = GetWorldTransform().Inverse();

	Node* root = GetRoot();
	for(Node* node = root; node; node=node->GetNext())
	{
		if(node->HasFlag(Node::VISUAL))
		{
			Visual* visual = static_cast<Visual*>(node);
			visual->Render(context, this);
		}
		else if(node->HasFlag(Node::LIGHT))
		{
			// render a light shape
		}
	}

}
开发者ID:albany551,项目名称:raytracer,代码行数:21,代码来源:camera.cpp


示例11: GetChild

UIElement* UIElement::HitTest(gm::PointF point)
{
	int nchildren = (int)GetChildrenCount();
	for (int i = nchildren-1; i >= 0; --i)
	{
		Visual* child = GetChild(i);
		ASSERT(child);

		UIElement* hitElement = child->HitTest_(point);
		if (hitElement != nullptr)
		{
			return hitElement;
		}
	}

	/*
	//  TODO remove, done above?
	UIElement* shadowTree = get_ShadowTree();
	if (shadowTree)
	{
		UIElement* hitElement = shadowTree->HitTest_(point);
		if (hitElement)
		{
			return hitElement;
		}
	}
	*/

	geometry hitGeometry = GetHitGeometry();
//	geometry hitGeometry = get_VisibleGeometry();
//	if (hitGeometry != nullptr)
	{
		if (hitGeometry.FillContains(point))
		{
			return this;
		}
	}

	return nullptr;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:40,代码来源:UIElement.cpp


示例12: assertion

//----------------------------------------------------------------------------
bool SkinController::Update (double applicationTime)
{
    if (!Controller::Update(applicationTime))
    {
        return false;
    }

    // Get access to the vertex buffer to store the blended targets.
    Visual* visual = StaticCast<Visual>(mObject);
    assertion(mNumVertices == visual->GetVertexBuffer()->GetNumElements(),
        "Controller must have the same number of vertices as the buffer\n");
    VertexBufferAccessor vba(visual);

    // The skin vertices are calculated in the bone world coordinate system,
    // so the visual's world transform must be the identity.
    visual->WorldTransform = Transform::IDENTITY;
    visual->WorldTransformIsCurrent = true;

    // Compute the skin vertex locations.
    for (int vertex = 0; vertex < mNumVertices; ++vertex)
    {
        APoint position = APoint::ORIGIN;
        for (int bone = 0; bone < mNumBones; ++bone)
        {
            float weight = mWeights[vertex][bone];
            if (weight != 0.0f)
            {
                APoint offset = mOffsets[vertex][bone];
                APoint worldOffset = mBones[bone]->WorldTransform*offset;
                position += weight*worldOffset;
            }
        }
        vba.Position<Float3>(vertex) = position;
    }

    visual->UpdateModelSpace(Visual::GU_NORMALS);
    Renderer::UpdateAll(visual->GetVertexBuffer());
    return true;
}
开发者ID:fishxz,项目名称:omni-bot,代码行数:40,代码来源:Wm5SkinController.cpp


示例13: Size

bool Pdb::Tip(const String& exp, CodeEditor::MouseTip& mt)
{
/*	mt.display = &StdDisplay();
	mt.value = exp;
	mt.sz = Size(100, 20);
	return true;*/
	DR_LOG("Pdb::Tip");
	Visual r;
	try {
		CParser p(exp);
		Val v = Exp(p);
		Visualise(r, v, 2);
		if(r.part.GetCount()) {
			mt.sz = r.GetSize() + Size(4, 4);
			mt.value = RawPickToValue(r);
			mt.display = &Single<VisualDisplay>();
			DR_LOG("Pdb::Tip true");
			return true;
		}
	}
	catch(CParser::Error) {}
	DR_LOG("Pdb::Tip false");
	return false;
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:24,代码来源:Data.cpp


示例14: SetWindow

	void SetWindow(CoreWindow const & window)
	{
		Compositor compositor;
		ContainerVisual root = compositor.CreateContainerVisual();
		m_target = compositor.CreateTargetForCurrentView();
		m_target.Root(root);
		m_visuals = root.Children();

		window.PointerPressed([&](auto const &, PointerEventArgs const & args)
		{
			Point point = args.CurrentPoint().Position();

			if (args.KeyModifiers() == VirtualKeyModifiers::Control)
			{
				AddVisual(point);
			}
			else
			{
				SelectVisual(point);
			}
		});

		window.PointerMoved([&](auto const &, PointerEventArgs const & args)
		{
			if (m_selected)
			{
				Point point = args.CurrentPoint().Position();

				m_selected.Offset(Vector3
				{
					point.X + m_offset.X,
					point.Y + m_offset.Y
				});
			}
		});

		window.PointerReleased([&](auto const &, auto const &)
		{
			m_selected = nullptr;
		});
	}
开发者ID:respu,项目名称:modern,代码行数:41,代码来源:App.cpp


示例15: parseVisual

bool parseVisual(Visual &vis, TiXmlElement *config)
{
  vis.clear();

  // Origin
  TiXmlElement *o = config->FirstChildElement("origin");
  if (o) {
    if (!parsePose(vis.origin, o))
      return false;
  }

  // Geometry
  TiXmlElement *geom = config->FirstChildElement("geometry");
  vis.geometry = parseGeometry(geom);
  if (!vis.geometry)
    return false;

  const char *name_char = config->Attribute("name");
  if (name_char)
    vis.name = name_char;

  // Material
  TiXmlElement *mat = config->FirstChildElement("material");
  if (mat) {
    // get material name
    if (!mat->Attribute("name")) {
      logError("Visual material must contain a name attribute");
      return false;
    }
    vis.material_name = mat->Attribute("name");

    // try to parse material element in place
    resetPtr(vis.material,new Material());
    if (!parseMaterial(*vis.material, mat, true))
    {
      logDebug("urdfdom: material has only name, actual material definition may be in the model");
    }
  }

  return true;
}
开发者ID:PerryZh,项目名称:idyntree,代码行数:41,代码来源:link.cpp


示例16: atof

	/* PUBLIC STATIC FUNCTIONS */
	VisualWavesControl *VisualWavesControl::load(std::string file)
	{
		XMLNode doc = XMLNode::openFileHelper(file.c_str(), XML_WAVES_CONTROL);

		float width = atof(doc.getAttribute(XML_WIDTH));
		std::string visualName = doc.getAttribute(XML_VISUAL);
		
		WavesGlobalState *wgs = WavesGlobalState::getInstance();
		assert(wgs != NULL);

		const std::vector<Visual *> factoryVisuals = wgs->getFactoryVisuals();
		
		Visual *visual = NULL;
		for(unsigned int i = 0; i < factoryVisuals.size(); i++)
		{
			Visual *cmp = factoryVisuals[i];
			assert(cmp != NULL);

			if(cmp->getName() == visualName)
			{
				visual = cmp->getInstance();
				break;
			}
		}

		if(visual == NULL)
		{
			return NULL;
		}
		else
		{
			assert(visual != NULL);

			XMLNode positionNode = doc.getChildNode(XML_POSITION);
			float x = atof(positionNode.getAttribute(XML_X));
			float y = atof(positionNode.getAttribute(XML_Y));
			Point2f position(x, y);

			std::string nickname = doc.getAttribute(XML_NICKNAME);

			bool forOutput = (bool)atoi(doc.getAttribute(XML_FOR_OUTPUT));

			// load tracks
			std::vector<Track *> tracks;
			unsigned int trackCount = doc.nChildNode(XML_TRACK);
			for(unsigned int i = 0; i < trackCount; i++)
			{
				XMLNode trackNode = doc.getChildNode(XML_TRACK, i);

				XMLNode trackPositionNode = trackNode.getChildNode(XML_POSITION);
				float tx = atof(trackPositionNode.getAttribute(XML_X));
				float ty = atof(trackPositionNode.getAttribute(XML_Y));
				Point2f position(tx, ty);

				float width = atof(trackNode.getAttribute(XML_WIDTH));
				float height = atof(trackNode.getAttribute(XML_HEIGHT));

				std::string parameterName = trackNode.getAttribute(XML_PARAMETER);
				Parameter *parameter = visual->getParameter(parameterName);

				Track *track = new Track(position, width, height, parameter);	
				std::map<unsigned int, SplinePreset *> &splinePresets = wgs->getSplinePresets();

				Track::TrackMode mode = (Track::TrackMode)atoi(trackNode.getAttribute(XML_MODE));
				track->setMode(mode);

				// load presets for menu
				unsigned int numFFTPresets = trackNode.nChildNode(XML_FFT_PRESET);
				for(unsigned int j = 0; j < numFFTPresets; j++)
				{
					XMLNode fftPresetNode = trackNode.getChildNode(XML_FFT_PRESET, j);
					unsigned int pId = atoi(fftPresetNode.getAttribute(XML_ID));
					track->addFFTPreset(pId);
				}

				unsigned int numtemporalPresets = trackNode.nChildNode(XML_TEMPORAL_PRESET);
				for(unsigned int j = 0; j < numtemporalPresets; j++)
				{
					XMLNode temporalPresetNode = trackNode.getChildNode(XML_TEMPORAL_PRESET, j);
					unsigned int pId = atoi(temporalPresetNode.getAttribute(XML_ID));
					track->addTemporalPreset(pId);
				}

				// load current presets (if any)
				std::map<unsigned int, SplinePreset *> &loadedPresets = wgs->getSplinePresets();
				std::map<unsigned int, SplinePreset *> &defaultPresets = wgs->getDefaultPresets();

				bool hasTemporalCurrentPreset = (bool)trackNode.isAttributeSet(XML_TEMPORAL_PRESET);
				if(hasTemporalCurrentPreset)
				{
					unsigned int temporalCurrentPreset = atoi(trackNode.getAttribute(XML_TEMPORAL_PRESET));
					
					SplinePreset *sp = NULL;
					
					if(loadedPresets.count(temporalCurrentPreset) > 0)
					{
						sp = loadedPresets[temporalCurrentPreset];
					}
					else if(defaultPresets.count(temporalCurrentPreset) > 0)
//.........这里部分代码省略.........
开发者ID:jonathanhook,项目名称:Waves,代码行数:101,代码来源:VisualWavesControl.cpp


示例17: glEnable

/**
 * Renders the area and all its objects.
 * @param rm The resource manager to use to manage models and images.
 */
void Area::draw(Interface* interface) {
#warning ['TODO']: Delete me....
    ResourceManager* rm = interface->getResourceManager();
    if(!rm) {
        return;
    }

    glEnable(GL_LIGHTING);
    glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
    //glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);

    /* This was cut, attenuation never worked right for some reason...
    // Disable unused lights
    for(int i = 0; i < MAX_LIGHTS; i++) {
    	glDisable(GL_LIGHT0 + i);
    }

    // Process lights
    int light = 0; // We want to skip the first light as its a global one...
    for(vector<Light*>::iterator iter = lights_.begin(); iter != lights_.end(); iter++) {
    	if(light > MAX_LIGHTS) {
    		break;
    	}
    	Light* pl = *iter;
    	if(!pl) {
    		ERROR("A Light that is Not a light...");
    		continue;
    	}
    	glEnable(GL_LIGHT0 + light);

    	// Set light position
    	float position[] = {pl->getX(), pl->getY(), pl->getX(), pl->getDirectional()};
    	glLightfv(GL_LIGHT0 + light, GL_POSITION, position);

    	float argba[] = {pl->ambient.red, pl->ambient.green, pl->ambient.blue, pl->ambient.alpha};
    	glLightfv(GL_LIGHT0+light, GL_AMBIENT, argba);

    	float drgba[] = {pl->diffuse.red, pl->diffuse.green, pl->diffuse.blue, pl->diffuse.alpha};
    	glLightfv(GL_LIGHT0+light, GL_DIFFUSE, drgba);

    	float srgba[] = {pl->specular.red, pl->specular.green, pl->specular.blue, pl->specular.alpha};
    	glLightfv(GL_LIGHT0+light, GL_SPECULAR, srgba);

    	float ergba[] = {pl->emission.red, pl->emission.green, pl->emission.blue, pl->emission.alpha};
    	glLightfv(GL_LIGHT0+light, GL_EMISSION, ergba);

    	glLightf(GL_LIGHT0+light, GL_CONSTANT_ATTENUATION, pl->getConstantAttenuation());
    	glLightf(GL_LIGHT0+light, GL_LINEAR_ATTENUATION, pl->getLinearAttenuation());
    	glLightf(GL_LIGHT0+light, GL_QUADRATIC_ATTENUATION, pl->getQuadraticAttenuation());

    	light++;
    }*/

    glPushMatrix();
    glTranslatef( TILEWIDTH * width_ / 2, 0.0f, TILEWIDTH * height_ / 2 );
    for(int y = 0; y < height_; y++) {
        glPushMatrix();
        for(int x = 0; x < width_; x++) {
            Tile* tile = getTile(x, y);
            if(tile) {
                if(interface->getEditMode() != MODE_NONE) {
                    glEnable(GL_COLOR_MATERIAL);
                    if(getSolid(x, y)) {
                        glColor3f(1.0, 0.0, 0.0);
                    } else {
                        glColor3f(1.0, 1.0, 1.0);
                    }
                    tile->draw(interface);
                } else {
                    tile->draw(interface);
                }
            }
            glTranslatef(-TILEWIDTH, 0.0f, 0.0f);
        }
        glPopMatrix();
        glTranslatef(0.0f, 0.0f, -TILEWIDTH);
    }
    glPopMatrix();

    // draw all the objects in the map
    for(vector<Contained*>::iterator iter = children_.begin(); iter != children_.end(); iter++) {
        Visual* object = dynamic_cast<Visual*>(*iter);
        if(object) {
            object->draw(interface);
        }
    }
}
开发者ID:dcbishop,项目名称:tx,代码行数:91,代码来源:Area.cpp


示例18: GetChildrenCount

void UIElement::Render(ManagedRenderContext renderContext)
{
	size_t nchildren = GetChildrenCount();
	for (size_t i = 0; i < nchildren; ++i)
	{
		Visual* child = GetChild(i);
		child->Render_(renderContext);
	}

	if (!m_visualValid)
	{
		m_visualValid = true;
		if (m_visuals)
		{
			if (m_visuals->get_Children())
			{
				m_visuals->get_Children()->m_items.clear();
			}

			RetainedRenderContext rrc(GetRoot(), m_visuals);
			ManagedRetainedRenderContext retainedRenderContext(&rrc);
			RenderRetained(retainedRenderContext);
		}
	}

	if (m_visuals)
	{
		m_visuals->Render_(renderContext);
	}

#if 0

	UIElement* shadowTree = get_ShadowTree();

	if (shadowTree == nullptr)
	{
		m_visuals = new GroupVisual;
		set_ShadowTree(m_visuals);

		shadowTree = m_visuals;
		m_visualValid = false;
	}

	if (!m_visualValid)
	{
		m_visualValid = true;
		if (m_visuals)
		{
			if (m_visuals->get_Children())
			{
				m_visuals->get_Children()->m_items.clear();
			}

			RetainedRenderContext rrc(GetRoot(), m_visuals);
			ManagedRetainedRenderContext retainedRenderContext(&rrc);
			RenderRetained(retainedRenderContext);
		}
	}

	shadowTree->Render_(renderContext);
#endif
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:62,代码来源:UIElement.cpp


示例19: GetRoot

void UIElement::OnComputedPropertyValueChanged(PropertyValue* pPropertyVal, bool handled)
{
	if (pPropertyVal->m_dp == get_CursorProperty())
	{
		IRootVisual* root = GetRoot();
		if (root)
		{
			root->ElementSetMouseCursor(this);
		}
	}
	else if (pPropertyVal->m_dp == get_ShadowTreeProperty())
	{
		if (!handled)
		{
			UIElement* shadowTree = get_ShadowTree();
			if (shadowTree)
			{
				shadowTree->SetRoot(GetRoot());
				shadowTree->set_ParentWindow(get_ParentWindow());

				shadowTree->set_Parent(this);
				shadowTree->set_TemplatedOwner(this);

				InvalidateMeasure();
			}
		}
	}
	else if (pPropertyVal->m_dp == get_ParentProperty())
	{
		UIElement* parent = get_Parent();
		if (parent)
		{
			SetTreeLevel(parent->get_TreeLevel()+1);

			parent->InvalidateArrange();
		}
		else
		{
			set_TreeLevel(0);
		}
	}
	else if (pPropertyVal->m_dp == get_ParentWindowProperty())
	{
		Window* parentwindow = get_ParentWindow();

		UIElement* shadowTree = get_ShadowTree();
		if (shadowTree)
		{
			shadowTree->set_ParentWindow(parentwindow);
		}

		size_t nchildren = GetChildrenCount();
		for (size_t i = 0; i < nchildren; ++i)
		{
			Visual* child = GetChild(i);
			ASSERT(child);

			child->set_ParentWindow(parentwindow);
		}
	}
	else if (pPropertyVal->m_dp == get_TemplatedOwnerProperty())
	{
		UIElement* owner = get_TemplatedOwner();

		size_t nchildren = GetChildrenCount();
		for (size_t i = 0; i < nchildren; ++i)
		{
			Visual* child = GetChild(i);
			ASSERT(child);

			child->set_TemplatedOwner(owner);
		}
	}
	else if (pPropertyVal->m_dp == get_WidthProperty())
	{
		InvalidateMeasure();
		/*
		float minWidth = get_MinWidth();
		float width = get_Width();

		if (width < minWidth) width = minWidth;

		set_ActualWidth(width);
		*/
	}
	else if (pPropertyVal->m_dp == get_HeightProperty())
	{
		InvalidateMeasure();
/*
		float minHeight = get_MinHeight();
		float height = get_Height();

		if (height < minHeight) height = minHeight;

		set_ActualHeight(height);
		*/
	}
	else if (pPropertyVal->m_dp == get_ActualWidthProperty() ||
			pPropertyVal->m_dp == get_ActualHeightProperty())
	{
//.........这里部分代码省略.........
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:101,代码来源:UIElement.cpp


示例20: ASSERT

void TableView::handleEvent(System::Event* evt)
{
	ASSERT(0);
#if 0
	sysstring type = evt->get_type();

	if (evt->get_eventPhase() != System::CAPTURING_PHASE)
	{
		if (type == OLESTR("command"))
		{
			CommandInvokeEvent* cmdEvt = dynamic_cast<CommandInvokeEvent*>(evt);

			int ncolumn = cmdEvt->get_Command() - 100;
			Visual* column = m_list->m_treeHeader->m_columns[ncolumn];
			column->put_Visibility(column->get_Visibility()==Collapsed? Visible: Collapsed);
		}
		else if (type == OLESTR("contextmenu"))
		{
			evt->stopPropagation();
			MouseEvent* mouseEvt = dynamic_cast<MouseEvent*>(evt);

			OnContextMenu(mouseEvt);
		}
		else if (type == OLESTR("ItemStateChanging"))
		{
			evt->stopPropagation();

			int index = *dynamic_cast<IntObject*>(dynamic_cast<TreeItem*>(evt->get_target())->m_itemData);

			Record pRecord = m_table[index];

			CViewGroup* pMessage = new MailMessage;

			Field Subject = pRecord.get_Fields()[1];
			Field Headers = pRecord.get_Fields()[3];
			Field Content = pRecord.get_Fields()[4];

			ScrollViewer* pScroller = new ScrollViewer;
			{
				TextEdit* textView = new TextEdit;
				textView->put_textDocument(new TextDocument());
				textView->SetText(
					ConvertA2S((char*)Headers.GetData(), Headers.GetSize()) +
					OLESTR("\n") +
					ConvertA2S((char*)Content.GetData(), Content.GetSize()));

				pScroller->put_Content(textView);
			}
			pScroller->SetOwnerWindow(get_OwnerWindow());	// TODO remove

			pMessage->m_views.Add(pScroller);

			m_xmlDocumentWorkspace.Create(m_Canvas, pMessage);

			for (int i = 0; i < pMessage->m_sheets.GetSize(); i++)
			{
				CViewSheet* pViewSheet = pMessage->m_sheets[i];

				sysstring str;
				try
				{
					str = ConvertA2S((char*)Subject.GetData(), Subject.GetSize());
				}
				catch(int)
				{
					str = OLESTR("(Error)");
				}

				pViewSheet->m_tabElement->set_TextContent(str);
			}
		}
	}
#endif
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:74,代码来源:MailReaderFrame.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VisualEffectInstance类代码示例发布时间:2022-05-31
下一篇:
C++ Visitor类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap