Exemple #1
0
void FaceInstance::transformComponents (const Matrix4& matrix)
{
	if (isSelected()) {
		m_face->transform(matrix, false);
	}
	if (selectedVertices()) {
		if (m_vertexSelection.size() == 1) {
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]);
			m_face->assign_planepts(m_face->m_move_planeptsTransformed);
		} else if (m_vertexSelection.size() == 2) {
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]);
			m_face->assign_planepts(m_face->m_move_planeptsTransformed);
		} else if (m_vertexSelection.size() >= 3) {
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]);
			m_face->assign_planepts(m_face->m_move_planeptsTransformed);
		}
	}
	if (selectedEdges()) {
		if (m_edgeSelection.size() == 1) {
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]);
			m_face->assign_planepts(m_face->m_move_planeptsTransformed);
		} else if (m_edgeSelection.size() >= 2) {
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]);
			matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]);
			m_face->assign_planepts(m_face->m_move_planeptsTransformed);
		}
	}
}
bool FaceInstance::selectedComponents(SelectionSystem::EComponentMode mode) const {
	switch (mode) {
		case SelectionSystem::eVertex:
			return selectedVertices();
		case SelectionSystem::eEdge:
			return selectedEdges();
		case SelectionSystem::eFace:
			return isSelected();
		default:
			return false;
		}
}
Exemple #3
0
void FaceInstance::snapComponents (float snap)
{
	if (isSelected()) {
		snapto(snap);
	}
	if (selectedVertices()) {
		vector3_snap(m_face->m_move_planepts[0], snap);
		vector3_snap(m_face->m_move_planepts[1], snap);
		vector3_snap(m_face->m_move_planepts[2], snap);
		m_face->assign_planepts(m_face->m_move_planepts);
		planepts_assign(m_face->m_move_planeptsTransformed, m_face->m_move_planepts);
		m_face->freezeTransform();
	}
	if (selectedEdges()) {
		vector3_snap(m_face->m_move_planepts[0], snap);
		vector3_snap(m_face->m_move_planepts[1], snap);
		vector3_snap(m_face->m_move_planepts[2], snap);
		m_face->assign_planepts(m_face->m_move_planepts);
		planepts_assign(m_face->m_move_planeptsTransformed, m_face->m_move_planepts);
		m_face->freezeTransform();
	}
}
Exemple #4
0
bool FaceInstance::selectedComponents () const
{
	return selectedVertices() || selectedEdges() || isSelected();
}