/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Overlap between two circles. // It uses arc length on PERFECT, SINGLE_CURVE_AND_RADIUS, and SINGLE_CURVE, // and direct distance on OTHER. Float mBestOverlap;
// If one of border-widths is 0, do not calculate overlap, and draw circles // until it reaches the other side or exceeds mMaxCount. bool mHasZeroBorderWidth; bool mHasMore;
// The maximum number of filled/unfilled circles.
size_t mMaxCount;
// * top-width == left-width // * radius.width == radius.height // * top-width < radius.width * 2 // // All circles has same radii and are on single perfect circle's arc. // Overlap is known. // // Split the perfect circle's arc into 2n segments, each segment's length is // top-width * (1 - overlap). Place each circle's center point C_i on each // end of the segment, each circle's radius r_i is top-width / 2 // // ##### // ####### // perfect ######### // circle's ___---+#### // arc ##### __-- ## C_0 ## // | #####_- ###|### // | ####+#### ##|## // | ##/C_i ## | // | |###### | // | | ##### | // +->| | // | | // ##|## | // ###|### | // ####|#### | // ####+-------------------+ // ## C_n ## // ####### // #####
PERFECT,
// * top-width == left-width // * 0.5 < radius.width / radius.height < 2.0 // * top-width < min(radius.width, radius.height) * 2 // // All circles has same radii and are on single elliptic arc. // Overlap is known. // // Split the elliptic arc into 2n segments, each segment's length is // top-width * (1 - overlap). Place each circle's center point C_i on each // end of the segment, each circle's radius r_i is top-width / 2 // // ##### // ####### // ##### ######### // ####### ____----+#### // elliptic ######__--- ## C_0 ## // arc ##__+-### ###|### // | / # C_i # ##|## // +--> / ##### | // | | // ###|# | // ###|### | // ####|#### | // ####+------------------------+ // ## C_n ## // ####### // #####
SINGLE_CURVE_AND_RADIUS,
// * top-width != left-width // * 0 < min(top-width, left-width) // * 0.5 < radius.width / radius.height < 2.0 // * max(top-width, left-width) < min(radius.width, radius.height) * 2 // // All circles are on single elliptic arc. // Overlap is unknown. // // Place each circle's center point C_i on elliptic arc, each circle's // radius r_i is the distance between the center point and the inner curve. // The arc segment's length between C_i and C_{i-1} is // (r_i + r_{i-1}) * (1 - overlap). // // outer curve // / // / // / / center curve // / ####### / // /## /# // +# / # // /# / # // / # C_i / # // / # + # / // / # / \ # / inner curve // # / \ #/ // # / r_i \+ // #/ ##/ // / ####### / // /
SINGLE_CURVE,
// Other cases. // Circles are not on single elliptic arc. // Overlap are unknown. // // Place tangent point innerTangent on the inner curve and find circle's // center point C_i and radius r_i where the circle is also tangent to the // outer curve. // Distance between C_i and C_{i-1} is (r_i + r_{i-1}) * (1 - overlap). // // outer curve // / // / // / // / ####### // /## ## // +# # // /# \ # // / # \ # // / # + # / // / # C_i \ # / inner curve // # \ #/ // # r_i \+ // ## ##/ innerTangent // ####### / // /
OTHER
} mType;
size_t mI;
size_t mCount;
// Determine mType from parameters. void DetermineType(Float aBorderRadiusX, Float aBorderRadiusY);
// Reset calculation. void Reset(void);
// Find radius for the given tangent point on the inner curve such that the // circle is also tangent to the outer curve. void FindPointAndRadius(Point& C, Float& r, const Point& innerTangent, const Point& normal, Float t);
// Fill corner with dots with given overlap, and return the number of dots // and last two dots's overlap. bool GetCountAndLastOverlap(Float aOverlap, size_t* aCount, Float* aActualOverlap);
};
} // namespace mozilla
#endif/* mozilla_DottedCornerFinder_h_ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.25 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.