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


C++ MapLine类代码示例

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


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

示例1: fixProblem

	bool fixProblem(unsigned index, unsigned fix_type, MapEditor* editor)
	{
		if (index >= things.size())
			return false;

		if (fix_type == 0)
		{
			MapThing* thing = things[index];
			MapLine* line = lines[index];

			// Get nearest line point to thing
			fpoint2_t np = MathStuff::closestPointOnLine(thing->xPos(), thing->yPos(), line->x1(), line->y1(), line->x2(), line->y2());

			// Get distance to move
			double r = theGameConfiguration->thingType(thing->getType())->getRadius();
			double dist = MathStuff::distance(0, 0, r, r);

			editor->beginUndoRecord("Move Thing", true, false, false);

			// Move along line direction
			map->moveThing(thing->getIndex(), np.x - (line->frontVector().x * dist), np.y - (line->frontVector().y * dist));

			editor->endUndoRecord();

			return true;
		}

		return false;
	}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:29,代码来源:MapChecks.cpp

示例2: LOG_MESSAGE

void MapSpecials::applyLineSlopeThing(SLADEMap* map, MapThing* thing)
{
	int lineid = thing->intProperty("arg0");
	if (!lineid)
	{
		LOG_MESSAGE(1, "Ignoring line slope thing %d with no lineid argument", thing->getIndex());
		return;
	}

	// These are computed on first use, to avoid extra work if no lines match
	MapSector* containing_sector = nullptr;
	double thingz;

	vector<MapLine*> lines;
	map->getLinesById(lineid, lines);
	for (unsigned b = 0; b < lines.size(); b++)
	{
		MapLine* line = lines[b];

		// Line slope things only affect the sector on the side of the line
		// that faces the thing
		double side = MathStuff::lineSide(thing->point(), line->seg());
		MapSector* target = nullptr;
		if (side < 0)
			target = line->backSector();
		else if (side > 0)
			target = line->frontSector();
		if (!target)
			continue;

		// Need to know the containing sector's height to find the thing's true height
		if (!containing_sector)
		{
			int containing_sector_idx = map->sectorAt(thing->point());
			if (containing_sector_idx < 0)
				return;
			containing_sector = map->getSector(containing_sector_idx);
			thingz = (
				containing_sector->getPlane<p>().height_at(thing->point())
				+ thing->floatProperty("height")
			);
		}

		// Three points: endpoints of the line, and the thing itself
		plane_t target_plane = target->getPlane<p>();
		fpoint3_t p1(lines[b]->x1(), lines[b]->y1(), target_plane.height_at(lines[b]->point1()));
		fpoint3_t p2(lines[b]->x2(), lines[b]->y2(), target_plane.height_at(lines[b]->point2()));
		fpoint3_t p3(thing->xPos(), thing->yPos(), thingz);
		target->setPlane<p>(MathStuff::planeFromTriangle(p1, p2, p3));
	}
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:51,代码来源:MapSpecials.cpp

示例3: updateBBox

/* MapSector::updateBBox
 * Calculates the sector's bounding box
 *******************************************************************/
void MapSector::updateBBox()
{
	// Reset bounding box
	bbox.reset();

	for (unsigned a = 0; a < connected_sides.size(); a++)
	{
		MapLine* line = connected_sides[a]->getParentLine();
		if (!line) continue;
		bbox.extend(line->v1()->xPos(), line->v1()->yPos());
		bbox.extend(line->v2()->xPos(), line->v2()->yPos());
	}

	text_point.set(0, 0);
	setGeometryUpdated();
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:19,代码来源:MapSector.cpp

示例4: fixProblem

	bool fixProblem(unsigned index, unsigned fix_type, MapEditor* editor)
	{
		if (index >= lines.size())
			return false;

		MapLine* line = map->getLine(lines[index]);
		if (line->s2())
		{
			// Flip
			if (fix_type == 0)
			{
				line->flip();
				return true;
			}

			// Create sector
			else if (fix_type == 1)
			{
				fpoint2_t pos = line->dirTabPoint(0.1);
				editor->createSector(pos.x, pos.y);
				doCheck();
				return true;
			}
		}
		else
		{
			// Delete
			if (fix_type == 0)
			{
				map->removeLine(line);
				doCheck();
				return true;
			}

			// Create sector
			else if (fix_type == 1)
			{
				fpoint2_t pos = line->dirTabPoint(0.1);
				editor->createSector(pos.x, pos.y);
				doCheck();
				return true;
			}
		}

		return false;
	}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:46,代码来源:MapChecks.cpp

示例5: copy

/* MapLine::copy
 * Copies another map object [c]
 *******************************************************************/
void MapLine::copy(MapObject* c)
{
	if(getObjType() != c->getObjType())
		return;

	MapObject::copy(c);

	MapLine* l = static_cast<MapLine*>(c);

	if(side1 && l->side1)
		side1->copy(l->side1);

	if(side2 && l->side2)
		side2->copy(l->side2);

	setIntProperty("special", l->intProperty("special"));
}
开发者ID:Manuel-K,项目名称:SLADE,代码行数:20,代码来源:MapLine.cpp

示例6: isWithin

/* MapSector::isWithin
 * Returns true if the point is inside the sector
 *******************************************************************/
bool MapSector::isWithin(fpoint2_t point)
{
	// Check with bbox first
	if (!boundingBox().contains(point))
		return false;

	// Find nearest line in the sector
	double dist;
	double min_dist = 999999;
	MapLine* nline = nullptr;
	for (unsigned a = 0; a < connected_sides.size(); a++)
	{
		// Calculate distance to line
		//if (connected_sides[a] == NULL) {
		//	LOG_MESSAGE(3, "Warning: connected side #%i is a NULL pointer!", a);
		//	continue;
		//} else if (connected_sides[a]->getParentLine() == NULL) {
		//	LOG_MESSAGE(3, "Warning: connected side #%i has a NULL pointer parent line!", connected_sides[a]->getIndex());
		//	continue;
		//}
		dist = connected_sides[a]->getParentLine()->distanceTo(point);

		// Check distance
		if (dist < min_dist)
		{
			nline = connected_sides[a]->getParentLine();
			min_dist = dist;
		}
	}

	// No nearest (shouldn't happen)
	if (!nline)
		return false;

	// Check the side of the nearest line
	double side = MathStuff::lineSide(point, nline->seg());
	if (side >= 0 && nline->frontSector() == this)
		return true;
	else if (side < 0 && nline->backSector() == this)
		return true;
	else
		return false;
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:46,代码来源:MapSector.cpp

示例7: remove

/** Removes the map entry of the given font.
 *  If the font is locked (because it's already in use) nothing happens.
 *  @param[in] mapline parsed font data
 *  @return true if entry has been removed */
bool FontMap::remove (const MapLine &mapline) {
	bool removed = false;
	if (!mapline.texname().empty()) {
		vector<Subfont*> subfonts;
		if (mapline.sfd())
			mapline.sfd()->subfonts(subfonts);
		else
			subfonts.push_back(nullptr);
		for (const Subfont *subfont : subfonts) {
			string fontname = mapline.texname()+(subfont ? subfont->id() : "");
			auto it = _entries.find(fontname);
			if (it != _entries.end() && !it->second->locked) {
				_entries.erase(it);
				removed = true;
			}
		}
	}
	return removed;
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:23,代码来源:FontMap.cpp

示例8: getVertices

/* MapSector::getVertices
 * Adds all vertices that are part of the sector to [list]
 *******************************************************************/
bool MapSector::getVertices(vector<MapObject*>& list)
{
	// Go through connected sides
	MapLine* line;
	for (unsigned a = 0; a < connected_sides.size(); a++)
	{
		line = connected_sides[a]->getParentLine();

		// Add the side's parent line's vertices to the list if they doesn't already exist
		if (line->v1() && std::find(list.begin(), list.end(), line->v1()) == list.end())
			list.push_back(line->v1());
		if (line->v2() && std::find(list.begin(), list.end(), line->v2()) == list.end())
			list.push_back(line->v2());
	}

	return true;
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:20,代码来源:MapSector.cpp

示例9: doCheck

	void doCheck()
	{
		double radius;

		// Get list of lines to check
		vector<MapLine*> check_lines;
		MapLine* line;
		for (unsigned a = 0; a < map->nLines(); a++)
		{
			line = map->getLine(a);

			// Skip if line is 2-sided and not blocking
			if (line->s2() && !theGameConfiguration->lineBasicFlagSet("blocking", line, map->currentFormat()))
				continue;

			check_lines.push_back(line);
		}

		// Go through things
		for (unsigned a = 0; a < map->nThings(); a++)
		{
			MapThing* thing = map->getThing(a);
			ThingType* tt = theGameConfiguration->thingType(thing->getType());

			// Skip if not a solid thing
			if (!tt->isSolid())
				continue;

			radius = tt->getRadius() - 1;

			// Go through lines
			for (unsigned b = 0; b < check_lines.size(); b++)
			{
				line = check_lines[b];

				// Check intersection
				if (MathStuff::boxLineIntersect(thing->xPos() - radius, thing->yPos() - radius,
					thing->xPos() + radius, thing->yPos() + radius,
					line->x1(), line->y1(), line->x2(), line->y2()))
				{
					things.push_back(thing);
					lines.push_back(line);
					break;
				}
			}
		}
	}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:47,代码来源:MapChecks.cpp

示例10: append

/** Appends given map line data to the font map if there is no entry for the corresponding
 *  font in the map yet.
 *  @param[in] mapline parsed font data
 *  @return true if data has been appended */
bool FontMap::append (const MapLine &mapline) {
	bool appended = false;
	if (!mapline.texname().empty()) {
		if (!mapline.fontfname().empty() || !mapline.encname().empty()) {
			vector<Subfont*> subfonts;
			if (mapline.sfd())
				mapline.sfd()->subfonts(subfonts);
			else
				subfonts.push_back(nullptr);
			for (Subfont *subfont : subfonts) {
				string fontname = mapline.texname()+(subfont ? subfont->id() : "");
				auto it = _entries.find(fontname);
				if (it == _entries.end()) {
					_entries.emplace(fontname, util::make_unique<Entry>(mapline, subfont));
					appended = true;
				}
			}
		}
	}
	return appended;
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:25,代码来源:FontMap.cpp

示例11: replace

/** Replaces the map data of the given font.
 *  If the font is locked (because it's already in use) nothing happens.
 *  @param[in] mapline parsed font data
 *  @return true if data has been replaced */
bool FontMap::replace (const MapLine &mapline) {
	if (mapline.texname().empty())
		return false;
	if (mapline.fontfname().empty() && mapline.encname().empty())
		return remove(mapline);

	vector<Subfont*> subfonts;
	if (mapline.sfd())
		mapline.sfd()->subfonts(subfonts);
	else
		subfonts.push_back(nullptr);
	for (Subfont *subfont : subfonts) {
		string fontname = mapline.texname()+(subfont ? subfont->id() : "");
		auto it = _entries.find(fontname);
		if (it == _entries.end())
			_entries.emplace(fontname, util::make_unique<Entry>(mapline, subfont));
		else if (!it->second->locked)
			*it->second = Entry(mapline, subfont);
	}
	return true;
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:25,代码来源:FontMap.cpp

示例12: findInMap

/* MapArchClipboardItem::pasteToMap
 * Pastes copied architecture to [map] at [position]
 *******************************************************************/
vector<MapVertex*> MapArchClipboardItem::pasteToMap(SLADEMap* map, fpoint2_t position)
{
    std::map<MapVertex*, MapVertex*> vertMap;
    std::map<MapSector*, MapSector*> sectMap;
    std::map<MapSide*, MapSide*> sideMap;
    // Not used yet...
    // std::map<MapLine*, MapLine*> lineMap;

    // Add vertices
    vector<MapVertex*> new_verts;
    for (unsigned a = 0; a < vertices.size(); a++)
    {
        new_verts.push_back(map->createVertex(position.x + vertices[a]->xPos(), position.y + vertices[a]->yPos()));
        new_verts.back()->copy(vertices[a]);
        vertMap[vertices[a]] = new_verts.back();
    }

    // Add sectors
    for (unsigned a = 0; a < sectors.size(); a++)
    {
        MapSector* new_sector = map->createSector();
        new_sector->copy(sectors[a]);
        sectMap[sectors[a]] = new_sector;
    }

    // Add sides
    int first_new_side = map->nSides();
    for (unsigned a = 0; a < sides.size(); a++)
    {
        // Get relative sector
        MapSector* sector = findInMap(sectMap, sides[a]->getSector());

        MapSide* new_side = map->createSide(sector);
        new_side->copy(sides[a]);
        sideMap[sides[a]] = new_side;
    }

    // Add lines
    int first_new_line = map->nLines();
    for (unsigned a = 0; a < lines.size(); a++)
    {
        // Get relative vertices
        MapVertex* v1 = findInMap(vertMap, lines[a]->v1());
        MapVertex* v2 = findInMap(vertMap, lines[a]->v2());

        if (!v1)
        {
            wxLogMessage("no v1");
            continue;
        }
        if (!v2)
        {
            wxLogMessage("no v2");
        }

        MapLine* newline = map->createLine(v1, v2, true);
        newline->copy(lines[a]);
        // lineMap[lines[a]] = newline;

        // Set relative sides
        bool s1 = false;
        bool s2 = !(lines[a]->s2());
        MapSide* newS1 = findInMap(sideMap, lines[a]->s1());
        MapSide* newS2 = findInMap(sideMap, lines[a]->s2());
        if(newS1)
            newline->setS1(newS1);
        if(newS2)
            newline->setS2(newS2);

        // Set important flags (needed when copying from Doom/Hexen format to UDMF)
        // Won't be needed when proper map format conversion stuff is implemented
        theGameConfiguration->setLineBasicFlag(
            "twosided",
            newline,
            map->currentFormat(),
            (newS1 && newS2)
        );
        theGameConfiguration->setLineBasicFlag(
            "blocking",
            newline,
            map->currentFormat(),
            !newS2
        );
    }

    // TODO:
    // - Split lines
    // - Merge lines

    //// Fix sector references
    //// TODO: figure out what lines are 'outside' on copy, only fix said lines
    //for (unsigned a = first_new_line; a < map->nLines(); a++)
    //{
    //	MapLine* line = map->getLine(a);
    //	MapSector* sec1 = map->getLineSideSector(line, true);
    //	MapSector* sec2 = map->getLineSideSector(line, false);
    //	int i1 = -1;
//.........这里部分代码省略.........
开发者ID:Blzut3,项目名称:SLADE,代码行数:101,代码来源:Clipboard.cpp

示例13: MapSector

/* MapArchClipboardItem::addLines
 * Copies [lines] and all related map structures
 *******************************************************************/
void MapArchClipboardItem::addLines(vector<MapLine*> lines)
{
    // Get sectors and sides to copy
    vector<MapSector*> copy_sectors;
    vector<MapSide*> copy_sides;
    for (unsigned a = 0; a < lines.size(); a++)
    {
        MapSide* s1 = lines[a]->s1();
        MapSide* s2 = lines[a]->s2();

        // Front side
        if (s1)
        {
            copy_sides.push_back(s1);
            if (std::find(copy_sectors.begin(), copy_sectors.end(), s1->getSector()) == copy_sectors.end())
                copy_sectors.push_back(s1->getSector());
        }

        // Back side
        if (s2)
        {
            copy_sides.push_back(s2);
            if (std::find(copy_sectors.begin(), copy_sectors.end(), s2->getSector()) == copy_sectors.end())
                copy_sectors.push_back(s2->getSector());
        }
    }

    // Copy sectors
    for (unsigned a = 0; a < copy_sectors.size(); a++)
    {
        MapSector* copy = new MapSector(NULL);
        copy->copy(copy_sectors[a]);
        sectors.push_back(copy);
    }

    // Copy sides
    for (unsigned a = 0; a < copy_sides.size(); a++)
    {
        MapSide* copy = new MapSide();
        copy->copy(copy_sides[a]);

        // Set relative sector
        for (unsigned b = 0; b < copy_sectors.size(); b++)
        {
            if (copy_sides[a]->getSector() == copy_sectors[b])
            {
                copy->setSector(sectors[b]);
                break;
            }
        }

        sides.push_back(copy);
    }

    // Get vertices to copy (and determine midpoint)
    double min_x = 9999999;
    double max_x = -9999999;
    double min_y = 9999999;
    double max_y = -9999999;
    vector<MapVertex*> copy_verts;
    for (unsigned a = 0; a < lines.size(); a++)
    {
        MapVertex* v1 = lines[a]->v1();
        MapVertex* v2 = lines[a]->v2();

        // Add vertices to copy list
        if (std::find(copy_verts.begin(), copy_verts.end(), v1) == copy_verts.end())
            copy_verts.push_back(v1);
        if (std::find(copy_verts.begin(), copy_verts.end(), v2) == copy_verts.end())
            copy_verts.push_back(v2);

        // Update min/max
        if (v1->xPos() < min_x) min_x = v1->xPos();
        if (v1->xPos() > max_x) max_x = v1->xPos();
        if (v1->yPos() < min_y) min_y = v1->yPos();
        if (v1->yPos() > max_y) max_y = v1->yPos();
        if (v2->xPos() < min_x) min_x = v2->xPos();
        if (v2->xPos() > max_x) max_x = v2->xPos();
        if (v2->yPos() < min_y) min_y = v2->yPos();
        if (v2->yPos() > max_y) max_y = v2->yPos();
    }

    // Determine midpoint
    double mid_x = min_x + ((max_x - min_x) * 0.5);
    double mid_y = min_y + ((max_y - min_y) * 0.5);
    this->midpoint.set(mid_x, mid_y);

    // Copy vertices
    for (unsigned a = 0; a < copy_verts.size(); a++)
    {
        MapVertex* copy = new MapVertex(copy_verts[a]->xPos() - mid_x, copy_verts[a]->yPos() - mid_y);
        copy->copy(copy_verts[a]);
        vertices.push_back(copy);
    }

    // Copy lines
    for (unsigned a = 0; a < lines.size(); a++)
//.........这里部分代码省略.........
开发者ID:Blzut3,项目名称:SLADE,代码行数:101,代码来源:Clipboard.cpp

示例14: findInMap

/* MapArchClipboardItem::pasteToMap
 * Pastes copied architecture to [map] at [position]
 *******************************************************************/
vector<MapVertex*> MapArchClipboardItem::pasteToMap(SLADEMap* map, fpoint2_t position)
{
	std::map<MapVertex*, MapVertex*> vertMap;
	std::map<MapSector*, MapSector*> sectMap;
	std::map<MapSide*, MapSide*> sideMap;
	// Not used yet...
	// std::map<MapLine*, MapLine*> lineMap;

	// Add vertices
	vector<MapVertex*> new_verts;
	for (unsigned a = 0; a < vertices.size(); a++)
	{
		new_verts.push_back(map->createVertex(position.x + vertices[a]->xPos(), position.y + vertices[a]->yPos()));
		new_verts.back()->copy(vertices[a]);
		vertMap[vertices[a]] = new_verts.back();
	}

	// Add sectors
	for (unsigned a = 0; a < sectors.size(); a++)
	{
		MapSector* new_sector = map->createSector();
		new_sector->copy(sectors[a]);
		sectMap[sectors[a]] = new_sector;
	}

	// Add sides
	int first_new_side = map->nSides();
	for (unsigned a = 0; a < sides.size(); a++)
	{
		// Get relative sector
		MapSector* sector = findInMap(sectMap, sides[a]->getSector());

		MapSide* new_side = map->createSide(sector);
		new_side->copy(sides[a]);
		sideMap[sides[a]] = new_side;
	}

	// Add lines
	int first_new_line = map->nLines();
	for (unsigned a = 0; a < lines.size(); a++)
	{
		// Get relative vertices
		MapVertex* v1 = findInMap(vertMap, lines[a]->v1());
		MapVertex* v2 = findInMap(vertMap, lines[a]->v2());

		if (!v1)
		{
			wxLogMessage("no v1");
			continue;
		}
		if (!v2)
		{
			wxLogMessage("no v2");
		}

		MapLine* newline = map->createLine(v1, v2, true);
		newline->copy(lines[a]);
		// lineMap[lines[a]] = newline;

		// Set relative sides
		bool s1 = false;
		bool s2 = !(lines[a]->s2());
		MapSide* newS1 = findInMap(sideMap, lines[a]->s1());
		MapSide* newS2 = findInMap(sideMap, lines[a]->s2());
		if(newS1)
			newline->setS1(newS1);
		if(newS2)
			newline->setS2(newS2);
	}

	// TODO:
	// - Split lines
	// - Merge lines

	// Fix sector references
	// TODO: figure out what lines are 'outside' on copy, only fix said lines
	for (unsigned a = first_new_line; a < map->nLines(); a++)
	{
		MapLine* line = map->getLine(a);
		MapSector* sec1 = map->getLineSideSector(line, true);
		MapSector* sec2 = map->getLineSideSector(line, false);
		int i1 = -1;
		int i2 = -2;
		if (sec1) i1 = sec1->getIndex();
		if (sec2) i2 = sec2->getIndex();
		map->setLineSector(a, i1, true);
		map->setLineSector(a, i2, false);
	}

	return new_verts;
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:94,代码来源:Clipboard.cpp

示例15: if

/* InfoOverlay3D::update
 * Updates the info text for the object of [item_type] at [item_index]
 * in [map]
 *******************************************************************/
void InfoOverlay3D::update(int item_index, int item_type, SLADEMap* map)
{
	// Clear current info
	info.clear();
	info2.clear();

	// Setup variables
	current_type = item_type;
	texname = "";
	texture = NULL;
	thing_icon = false;
	int map_format = theMapEditor->currentMapDesc().format;

	// Wall
	if (item_type == MapEditor::SEL_SIDE_BOTTOM || item_type == MapEditor::SEL_SIDE_MIDDLE || item_type == MapEditor::SEL_SIDE_TOP)
	{
		// Get line and side
		MapSide* side = map->getSide(item_index);
		if (!side) return;
		MapLine* line = side->getParentLine();
		if (!line) return;
		object = side;

		// --- Line/side info ---
		info.push_back(S_FMT("Line #%d", line->getIndex()));
		if (side == line->s1())
			info.push_back(S_FMT("Front Side #%d", side->getIndex()));
		else
			info.push_back(S_FMT("Back Side #%d", side->getIndex()));

		// Relevant flags
		string flags = "";
		if (theGameConfiguration->lineBasicFlagSet("dontpegtop", line, map_format))
			flags += "Upper Unpegged, ";
		if (theGameConfiguration->lineBasicFlagSet("dontpegbottom", line, map_format))
			flags += "Lower Unpegged, ";
		if (theGameConfiguration->lineBasicFlagSet("blocking", line, map_format))
			flags += "Blocking, ";
		if (!flags.IsEmpty())
			flags.RemoveLast(2);
		info.push_back(flags);

		info.push_back(S_FMT("Length: %d", (int)line->getLength()));

		// Other potential info: special, sector#


		// --- Wall part info ---

		// Part
		if (item_type == MapEditor::SEL_SIDE_BOTTOM)
			info2.push_back("Lower Texture");
		else if (item_type == MapEditor::SEL_SIDE_MIDDLE)
			info2.push_back("Middle Texture");
		else
			info2.push_back("Upper Texture");

		// Offsets
		if (theGameConfiguration->udmfNamespace() == "zdoom")
		{
			// Get x offset info
			int xoff = side->intProperty("offsetx");
			double xoff_part = 0;
			if (item_type == MapEditor::SEL_SIDE_BOTTOM)
				xoff_part = side->floatProperty("offsetx_bottom");
			else if (item_type == MapEditor::SEL_SIDE_MIDDLE)
				xoff_part = side->floatProperty("offsetx_mid");
			else
				xoff_part = side->floatProperty("offsetx_top");

			// Add x offset string
			string xoff_info;
			if (xoff_part == 0)
				xoff_info = S_FMT("%d", xoff);
			else if (xoff_part > 0)
				xoff_info = S_FMT("%1.2f (%d+%1.2f)", (double)xoff+xoff_part, xoff, xoff_part);
			else
				xoff_info = S_FMT("%1.2f (%d-%1.2f)", (double)xoff+xoff_part, xoff, -xoff_part);

			// Get y offset info
			int yoff = side->intProperty("offsety");
			double yoff_part = 0;
			if (item_type == MapEditor::SEL_SIDE_BOTTOM)
				yoff_part = side->floatProperty("offsety_bottom");
			else if (item_type == MapEditor::SEL_SIDE_MIDDLE)
				yoff_part = side->floatProperty("offsety_mid");
			else
				yoff_part = side->floatProperty("offsety_top");

			// Add y offset string
			string yoff_info;
			if (yoff_part == 0)
				yoff_info = S_FMT("%d", yoff);
			else if (yoff_part > 0)
				yoff_info = S_FMT("%1.2f (%d+%1.2f)", (double)yoff+yoff_part, yoff, yoff_part);
			else
//.........这里部分代码省略.........
开发者ID:Manuel-K,项目名称:SLADE,代码行数:101,代码来源:InfoOverlay3d.cpp


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