(; seg_it; seg_it.Advance()) {
82 TSeqPos t= seg_it.GetSeqRunEndPosition();
99vector<TSeqRange> gaps;
118 for(
auto&& gap : gaps) {
119rasterizer.
AddInterval(gap.GetFrom(), gap.GetToOpen(), 1., [](
float& dst,
const float& src,
floatfraction,
bool) {
120dst = min<float>(1., dst + fraction);
124gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
127 auto& raster = rasterizer.
GetRaster();
129 static const floatkGaps_Threshold = 0.025f;
133 for(
size_tx1 = 0; x1 < raster.size();) {
134 if(raster[x1] < kGaps_Threshold) {
139 float val= max<float>(0.25, raster[x1]);
140 while(++x2 < raster.size()) {
141 const float& new_val = raster[x2];
142 if(new_val < kGaps_Threshold || max<float>(0.25, new_val) !=
val)
145 size_tnext_pos = x2;
152 doublestart = x1 + shift_x;
153 doublestop = x2 + shift_x;
155gl.
Begin(GL_LINES);
160gl.
Rectd(start, top, stop, bottom);
195 if(m_RangesCache.capacity() <= m_ReservedCount)
196m_RangesCache.reserve(m_ReservedCount);
197 if(m_RangesCache.capacity() == m_RangesCache.size()) {
199m_RangesCache.reserve(m_ReservedCount);
203item.
from= range_it->GetFrom();
204item.
to= range_it->GetTo();
206m_RangesCache.push_back(item);
213 size_tsz = m_RangesCache.size();
214writer.
Write(
reinterpret_cast<const char*
>(&sz),
sizeof(sz));
215writer.
Write(
reinterpret_cast<const char*
>(&m_RangesCache[0]), m_RangesCache.size() *
sizeof(m_RangesCache[0]));
222reader.
Read(
reinterpret_cast<char*
>(&sz),
sizeof(sz));
223m_RangesCache.resize(sz);
225 size_tbuf_size = sz *
sizeof(m_RangesCache[0]);
226 char* buf_ptr =
reinterpret_cast<char*
>(&m_RangesCache[0]);
227 while(buf_size > 0) {
228 ERW_Resultrw_res = reader.
Read(buf_ptr, buf_size, &bytes_read);
230buf_ptr += bytes_read;
231buf_size -= bytes_read;
232}
else if(rw_res ==
eRW_Eof) {
239 for(
size_t i= 0;
i< m_RangesCache.size(); ++
i) {
250m_Bins.resize(x_CalcNbins(), m_DefVal);
252 for(
size_t i= 0;
i< m_RangesCache.size(); ++
i) {
261 for(
size_t i= 0;
i< m_RangesCache.size(); ++
i) {
Run iterator. iterate through runs of equal values in the bins.
TModelUnit GetVisibleFrom() const
CRef< CSGSequenceDS > GetSeqDS() const
CGlPane * GetGlPane()
inline method implementations
const TModelRange & GetVisibleRange() const
TVPUnit SeqToScreenX(const TModelUnit &size) const
TModelUnit GetVisibleTo() const
void DrawQuad(const TModelRect &rc, bool border=false) const
const TModelUnit & GetScale() const
void Draw3DQuad(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
class CRgbaColor provides a simple abstraction for managing colors.
TSeqPos GetSequenceLength() const
void AddRanges(CRangeCollection< TSeqPos > ranges, TValueType score=1, bool expand=false)
void AddRange(TSeqRange range, TValueType score=1, bool expand=false)
std::vector< SRangeItem > m_RangesCache
void Deserialize(IReader &reader)
void GetGaps(const TModelRange &range, vector< TSeqRange > &gaps)
void SetRange(const TSeqRange &range)
void Serialize(IWriter &writer) const
virtual void x_Draw() const
The default renderer for this layout object.
unique_ptr< CSegMap > m_SegMap
CSegmentSmearGlyph(CSegMap *map)
virtual bool IsClickable() const
Query if this glyph is clickable.
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
virtual bool NeedTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Check if need to show tooltip.
TColorCode m_Colors
color code for segment map.
virtual void GetTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
CRenderingContext * m_Context
the rendering context
virtual void SetWidth(TModelUnit w)
virtual void SetLeft(TModelUnit l)
virtual TModelUnit GetTop() const
virtual TModelUnit GetHeight() const
A very basic data-read interface.
A very basic data-write interface.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Scalef(GLfloat x, GLfloat y, GLfloat z)=0
const TRaster & GetRaster() const
virtual void Enable(GLenum glstate)=0
virtual void Begin(GLenum mode)=0
Start rendering.
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
TVPRect & GetViewport(void)
virtual void PopAttrib()=0
virtual void PushAttrib(GLbitfield mask)=0
virtual void PopMatrix()=0
virtual void End()=0
Finish rendering (create buffer and send to renderer)
void AddInterval(TModelUnit min, TModelUnit max, const A &attr, F f_add)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
virtual void PushMatrix()=0
virtual void AddRanges(CRangeCollection< TSeqPos > ranges, CntType score=1, bool expand=false)
virtual void AddRange(TSeqRange range, CntType score=1, bool expand=false)
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
ERW_Result
Result codes for I/O operations.
virtual ERW_Result Flush(void)=0
Flush pending data (if any) down to the output device.
virtual ERW_Result Write(const void *buf, size_t count, size_t *bytes_written=0)=0
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)=0
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
@ eRW_Eof
End of data, should be considered permanent.
@ eRW_Success
Everything is okay, I/O completed.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const GenericPointer< typename T::ValueType > T2 value
Reader-writer based streams.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4